@@ -36,7 +36,7 @@ import {LivesyncApp, LivesyncTestRouterProviders} from "./examples/livesync-test
36
36
37
37
// new router
38
38
import { RouterOutletAppComponent } from "./examples/router/router-outlet-test" ;
39
- import { PageRouterOutletAppComponent , PageRouterOutletRouterProviders } from "./examples/router/page-router-outlet-test" ;
39
+ import { PageRouterOutletAppComponent } from "./examples/router/page-router-outlet-test" ;
40
40
import { PageRouterOutletNestedAppComponent , PageRouterOutletNestedRouterProviders } from "./examples/router/page-router-outlet-nested-test" ;
41
41
import { ClearHistoryAppComponent , ClearHistoryRouterProviders } from "./examples/router/clear-history-test" ;
42
42
import { LoginAppComponent , LoginExampleProviders } from "./examples/router/login-test" ;
@@ -47,12 +47,6 @@ import { AnimationKeyframesTest } from "./examples/animation/animation-keyframes
47
47
import { AnimationNgClassTest } from "./examples/animation/animation-ngclass-test" ;
48
48
import { AnimationStatesTest } from "./examples/animation/animation-states-test" ;
49
49
50
- // nativeScriptBootstrap(RendererTest);
51
- //nativeScriptBootstrap(TabViewTest);
52
- //nativeScriptBootstrap(Benchmark);
53
- // nativeScriptBootstrap(ListTest);
54
- // nativeScriptBootstrap(ListTestAsync);
55
- //nativeScriptBootstrap(ImageTest);
56
50
// nativeScriptBootstrap(HttpTest);
57
51
//nativeScriptBootstrap(ActionBarTest, [NS_ROUTER_PROVIDERS_DEPRECATED], { startPageActionBarHidden: false });
58
52
//nativeScriptBootstrap(ActionBarTest, [NS_ROUTER_PROVIDERS_DEPRECATED]);
@@ -83,24 +77,34 @@ import { AnimationStatesTest } from "./examples/animation/animation-states-test"
83
77
} )
84
78
class ExampleModule { }
85
79
86
- @NgModule ( { bootstrap : [ RendererTest ] , declarations : [ RendererTest ] , imports : [ ExampleModule ] } )
87
- class RendererTestModule { }
88
-
89
- @NgModule ( { bootstrap : [ PageRouterOutletAppComponent ] , imports : [ ExampleModule ] } )
90
- class PageRouterOutletAppModule { }
91
-
92
- @NgModule ( {
93
- bootstrap : [ RouterOutletAppComponent ] ,
94
- imports : [
95
- ExampleModule ,
96
- NativeScriptRouterModule . forRoot ( RouterOutletAppComponent . routes ) ,
97
- ] ,
98
- } )
99
- class RouterOutletAppModule { }
100
-
101
- //platformNativeScriptDynamic().bootstrapModule(RendererTestModule);
102
- platformNativeScriptDynamic ( ) . bootstrapModule ( RouterOutletAppModule ) ;
103
- //platformNativeScriptDynamic().bootstrapModule(PageRouterOutletAppModule);
80
+ function makeExampleModule ( componentType , routes = null , entryComponents = null ) {
81
+ let imports : any [ ] = [ ExampleModule ] ;
82
+ if ( routes ) {
83
+ imports . push ( NativeScriptRouterModule . forRoot ( routes ) )
84
+ }
85
+ let entries = [ ] ;
86
+ if ( entryComponents ) {
87
+ entries = entryComponents ;
88
+ }
89
+ @NgModule ( {
90
+ bootstrap : [ componentType ] ,
91
+ imports : imports ,
92
+ entryComponents : entries ,
93
+ declarations : entries ,
94
+ } )
95
+ class ExampleModuleForComponent { }
96
+
97
+ return ExampleModuleForComponent ;
98
+ }
99
+
100
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(RendererTest));
101
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(TabViewTest));
102
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(Benchmark));
103
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTest));
104
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTestAsync));
105
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ImageTest));
106
+ //platformNativeScriptDynamic().bootstrapModule(makeExampleModule(RouterOutletAppComponent, RouterOutletAppComponent.routes));
107
+ platformNativeScriptDynamic ( ) . bootstrapModule ( makeExampleModule ( PageRouterOutletAppComponent , PageRouterOutletAppComponent . routes , PageRouterOutletAppComponent . entries ) ) ;
104
108
105
109
// Livesync test
106
110
// var cahcedUrl: string;
0 commit comments