@@ -4,7 +4,7 @@ import * as angular from 'angular';
4
4
5
5
import { NgModule , forwardRef , ApplicationRef } from '@angular/core' ;
6
6
import { BrowserModule } from '@angular/platform-browser' ;
7
- import { UpgradeAdapter } from '@angular/upgrade' ;
7
+ import { UpgradeModule , downgradeComponent } from '@angular/upgrade/static ' ;
8
8
9
9
import { downgrade as utilitiesDowngrade , UtilitiesModule } from 'typescript-angular-utilities' ;
10
10
@@ -23,39 +23,36 @@ import { moduleName as textModuleName } from './text/text';
23
23
24
24
import { WelcomeComponent } from './welcome.component' ;
25
25
import { InputsRootComponent } from './inputs/inputRoot' ;
26
- import { InputsNg1BootstrapperComponent } from './inputs/inputBootstrapper' ;
26
+ import { InputsNg1BootstrapperComponent , InputsNg1Directive } from './inputs/inputBootstrapper' ;
27
27
import { InputsBootstrapper } from './inputs/inputsNg2Bootstrapper' ;
28
- import { ButtonsNg1BootstrapperComponent , ButtonsNg2BootstrapperComponent } from './buttons/buttonBootstrapper' ;
28
+ import { ButtonsNg1BootstrapperComponent , ButtonsNg1Directive } from './buttons/buttonBootstrapper' ;
29
+ import { ButtonsNg2BootstrapperComponent } from './buttons/buttonsNg2Bootstrapper' ;
29
30
import { ButtonsRootComponent } from './buttons/buttonRoot' ;
30
31
import { PopupRootComponent } from './popup/popupRoot' ;
31
- import { PopupNg1BootstrapperComponent } from './popup/popupBootstrapper' ;
32
+ import { PopupNg1BootstrapperComponent , PopupNg1Directive } from './popup/popupBootstrapper' ;
32
33
import { PopupBootstrapper } from './popup/popupNg2Bootstrapper' ;
33
34
import { CardsRootComponent } from './cards/cardRoot' ;
34
- import { CardsNg1BootstrapperComponent } from './cards/cardContainerBootstrapper' ;
35
+ import { CardsNg1BootstrapperComponent , CardsNg1Directive } from './cards/cardContainerBootstrapper' ;
35
36
import { CardsBootstrapper } from './cards/cardsNg2Bootstrapper' ;
36
37
import { CardsSmartDataBootstrapper } from './cards/cardsSmartDataBootstrapper' ;
37
38
import { TabsRootComponent } from './tabs/tabRoot' ;
38
- import { TabsNg1BootstrapperComponent } from './tabs/tabsBootstrapper' ;
39
+ import { TabsNg1BootstrapperComponent , TabsNg1Directive } from './tabs/tabsBootstrapper' ;
39
40
import { TabsBootstrapper } from './tabs/tabsNg2Bootstrapper' ;
40
41
import { MsiBootstrapperComponent } from './msi/msiBootstrapper.ng2' ;
41
42
import { FormsRootComponent } from './forms/formsRoot' ;
42
- import { FormsNg1BootstrapperComponent } from './forms/formsBootstrapper' ;
43
+ import { FormsNg1BootstrapperComponent , FormsNg1Directive } from './forms/formsBootstrapper' ;
43
44
import { FormsBootstrapper } from './forms/formsNg2Bootstrapper' ;
44
- import { MessageLogNg1BootstrapperComponent } from './messageLog/messageLogBootstrapper' ;
45
+ import { MessageLogNg1BootstrapperComponent , MessageLogNg1Directive } from './messageLog/messageLogBootstrapper' ;
45
46
import { MiscRootComponent } from './misc/miscRoot' ;
46
47
import { MiscNgContextBootstrapper } from './misc/miscNg2Context' ;
47
- import { MiscNg1BootstrapperComponent , MiscNg2BootstrapperComponent } from './misc/miscBootstrapper' ;
48
+ import { MiscNg1BootstrapperComponent , MiscNg2BootstrapperComponent , MiscNg1Directive , MiscNg2Directive } from './misc/miscBootstrapper' ;
48
49
import { App } from './app.ng2' ;
49
50
50
51
import { appRoutingProviders , routing } from './app.routing' ;
51
52
52
53
import { ComponentsModule } from '../source/ui.module' ;
53
54
54
- const upgradeAdapter : UpgradeAdapter = new UpgradeAdapter ( forwardRef ( ( ) => ComponentsBootstrapperModule ) ) ;
55
- utilitiesDowngrade . downgradeUtilitiesToAngular1 ( upgradeAdapter ) ;
56
- componentsDowngrade . downgradeComponentsToAngular1 ( upgradeAdapter ) ;
57
-
58
- const moduleName : string = 'bootstrapper-app' ;
55
+ export const moduleName : string = 'bootstrapper-app' ;
59
56
60
57
angular . module ( moduleName , [
61
58
componentsModule ,
@@ -71,74 +68,71 @@ angular.module(moduleName, [
71
68
miscModuleName ,
72
69
textModuleName ,
73
70
] )
74
- . directive ( 'tsApp' , < any > upgradeAdapter . downgradeNg2Component ( App ) )
75
- . directive ( 'tsMiscNgContext' , < any > upgradeAdapter . downgradeNg2Component ( MiscNgContextBootstrapper ) ) ;
71
+ . directive ( 'tsMiscNgContext' , downgradeComponent ( { component : MiscNgContextBootstrapper } ) ) ;
76
72
77
73
@NgModule ( {
78
74
imports : [
79
75
BrowserModule ,
80
76
routing ,
81
77
UtilitiesModule ,
82
78
ComponentsModule ,
79
+ UpgradeModule ,
83
80
] ,
84
81
declarations : [
85
82
InputsBootstrapper ,
86
83
InputsRootComponent ,
87
84
InputsNg1BootstrapperComponent ,
88
- upgradeAdapter . upgradeNg1Component ( 'tsInputsNg1' ) ,
85
+ InputsNg1Directive ,
89
86
90
87
ButtonsRootComponent ,
91
88
ButtonsNg1BootstrapperComponent ,
92
89
ButtonsNg2BootstrapperComponent ,
93
- upgradeAdapter . upgradeNg1Component ( 'tsButtonsNg1' ) ,
94
- upgradeAdapter . upgradeNg1Component ( 'tsButtonsNg2' ) ,
90
+ ButtonsNg1Directive ,
95
91
96
92
PopupRootComponent ,
97
93
PopupNg1BootstrapperComponent ,
98
94
PopupBootstrapper ,
99
- upgradeAdapter . upgradeNg1Component ( 'tsPopupNg1' ) ,
95
+ PopupNg1Directive ,
100
96
101
97
CardsRootComponent ,
102
98
CardsNg1BootstrapperComponent ,
103
99
CardsBootstrapper ,
104
100
CardsSmartDataBootstrapper ,
105
- upgradeAdapter . upgradeNg1Component ( 'tsCardsNg1' ) ,
101
+ CardsNg1Directive ,
106
102
107
103
TabsRootComponent ,
108
104
TabsNg1BootstrapperComponent ,
109
105
TabsBootstrapper ,
110
- upgradeAdapter . upgradeNg1Component ( 'tsTabsNg1' ) ,
106
+ TabsNg1Directive ,
111
107
112
108
MsiBootstrapperComponent ,
113
109
114
110
FormsRootComponent ,
115
111
FormsNg1BootstrapperComponent ,
116
112
FormsBootstrapper ,
117
- upgradeAdapter . upgradeNg1Component ( 'tsFormsNg1' ) ,
113
+ FormsNg1Directive ,
118
114
119
115
MessageLogNg1BootstrapperComponent ,
120
- upgradeAdapter . upgradeNg1Component ( 'tsMessageLogNg1' ) ,
116
+ MessageLogNg1Directive ,
121
117
122
118
MiscRootComponent ,
123
119
MiscNg1BootstrapperComponent ,
124
120
MiscNg2BootstrapperComponent ,
125
121
MiscNgContextBootstrapper ,
126
- upgradeAdapter . upgradeNg1Component ( 'tsMiscNg1' ) ,
127
- upgradeAdapter . upgradeNg1Component ( 'tsMiscNg2' ) ,
122
+ MiscNg1Directive ,
123
+ MiscNg2Directive ,
128
124
129
125
WelcomeComponent ,
130
126
App ,
131
127
] ,
128
+ bootstrap : [ App ] ,
129
+ entryComponents : [ MiscNgContextBootstrapper ] ,
132
130
providers : [
133
131
{
134
- provide : ApplicationRef ,
135
- useValue : {
136
- componentTypes : [ App ] ,
137
- registerDisposeListener : ( ) => { } ,
138
- } ,
139
- } ,
132
+ provide : '$scope' ,
133
+ useFactory : injector => injector . get ( '$rootScope' ) ,
134
+ deps : [ '$injector' ]
135
+ }
140
136
] ,
141
137
} )
142
- class ComponentsBootstrapperModule { }
143
-
144
- upgradeAdapter . bootstrap ( document . body , [ moduleName ] , { strictDI : true } ) ;
138
+ export class ComponentsBootstrapperModule { }
0 commit comments