@@ -5,9 +5,10 @@ import { SecondComponentActionBar } from "./action-bar/action-bar-second.compone
55
66import { AppComponent } from "./template/app.component" ;
77
8- import { FirstComponent } from "./components/first.component" ;
9- import { SecondComponent } from "./components/second.component" ;
10- import { NavigationTestRouter , NavigationSubRoutes } from "./router/router-outlet" ;
8+ import { FirstComponent } from "./router/router-outlet/first.component" ;
9+ import { SecondComponent } from "./router/router-outlet/second.component" ;
10+ import { NavigationComponent , NavigationSubRoutes } from "./router/router-outlet/navigation.component" ;
11+ import { LazyNavigationComponent } from "./router/lazy-module-navigation/lazy-navigation.component" ;
1112
1213import { BindingComponent } from "./binding/binding-page" ;
1314
@@ -22,6 +23,7 @@ import { ListPickerComponent } from "./list-picker/list-picker";
2223
2324import { ModalTest , ModalTestWithPushStrategy , ModalContent } from "./modal/modal-dialogs/modal-dialog.component" ;
2425import { ModalViewMainPageComponent } from "./modal/modal-view-main-page" ;
26+ import { LazyLoadModalComponent } from "./modal/lazy/lazy-load-modal.component" ;
2527
2628import { TabViewComponent } from "./tab-view/tab-view.component" ;
2729
@@ -34,7 +36,8 @@ export const routableComponents = [
3436 ModalContent ,
3537 AppComponent ,
3638
37- NavigationTestRouter ,
39+ NavigationComponent ,
40+ LazyNavigationComponent ,
3841
3942 FirstComponent ,
4043 SecondComponent ,
@@ -56,6 +59,7 @@ export const routableComponents = [
5659 ModalViewMainPageComponent ,
5760 ModalTest ,
5861 ModalTestWithPushStrategy ,
62+ LazyLoadModalComponent ,
5963
6064 TabViewComponent ,
6165
@@ -69,7 +73,8 @@ export const routes = [
6973 { path : '' , component : ModalContent , data : { title : "" } } ,
7074 { path : 'template' , component : AppComponent , data : { title : "Template" , isNavigatable : true } } ,
7175
72- { path : 'router' , component : NavigationTestRouter , children : NavigationSubRoutes , data : { title : "Router" , isNavigatable : true } } ,
76+ { path : 'router' , component : NavigationComponent , children : NavigationSubRoutes , data : { title : "Router" , isNavigatable : true } } ,
77+ { path : 'lazy-router' , component : LazyNavigationComponent , data : { title : "Lazy Router" , isNavigatable : true } } ,
7378
7479 { path : 'first' , component : FirstComponent , data : { title : "First" , isNavigatable : true } } ,
7580 { path : 'second' , component : SecondComponent , data : { title : "Second" , isNavigatable : true } } ,
@@ -91,10 +96,17 @@ export const routes = [
9196 { path : 'modal' , component : ModalViewMainPageComponent , data : { title : "Modals" , isNavigatable : true } } ,
9297 { path : 'modal/modal-dialogs' , component : ModalTest , data : { title : "modal" } } ,
9398 { path : 'modal/modal-dialogs-push' , component : ModalTestWithPushStrategy , data : { title : "modal(onPush)" } } ,
99+ { path : 'modal/lazy' , component : LazyLoadModalComponent , data : { title : "modal(lazy)" } } ,
94100
95101 { path : 'tab-view' , component : TabViewComponent , data : { title : "tab-view" , isNavigatable : true } } ,
96102
97103 { path : 'nav-options' , component : NavigationOptionsComponent , data : { title : "nav-options" , isNavigatable : true } } ,
98104 { path : 'nav-info' , component : NavigationInfoComponent , data : { title : "nav-info" } } ,
105+
106+ // Needed for AoT compilation
107+ {
108+ path : "lazy" ,
109+ loadChildren : "./lazy/lazy.module#LazyModule"
110+ } ,
99111] ;
100112
0 commit comments