Repository navigation
Please update howto for lazy loading a component #829
Description
Activity
Angular 2 is changing a lot, i think they will probably delay it a bit more until an official release, making docs for something that could easily change in a few weeks or months is time consuming.
Did you find any updates on this? See #967
I actually have Lazy loading working with child pages included, i think with RC.6 is rather easy.
@Luchillo example?
@paralin Here's mine, just starting a showcase repo but routes are working: https://github.com/Luchillo/Luchillo-tech-showcase
Why u dont use https://github.com/Quramy/angular2-load-children-loader ? (for webpack 2)
with es6-promise its look like,
export const appRoutes: Routes = [ {path: "", component: MainHomeComponent}, {path: "about", component: MainAboutComponent }, {path: "sub", loadChildren: "es6-promise!./sub.module#SubModule"} ];
Me? this repo? anyway it's to be more in sync with the future of JS,
System.importthough not yet available is part of the ES6 specification, thus when it is ready to be used the change should be minimal.At the end it is roughly the same result, only that the
System.importway will be ready for when that feature in the ES6 spec is available everywhere.just modify this code to imports section, replace this:
RouterModule.forRoot(ROUTES, {useHash: false, preloadingStrategy: PreloadAllModules}),
with this:
RouterModule.forRoot(ROUTES, {useHash: false, preloadingStrategy: NoPreloading}),more information at here:
https://angular.io/docs/ts/latest/guide/router.html#!#custom-preloading-strategyReacted by Amit Mittal
I can't bring lazy loading to work. The description here is very poor and should be updated for new router:
https://github.com/AngularClass/angular2-webpack-starter/wiki/How-do-I-async-load-a-component-with-AsyncRoute
Please have a look at my stackoverflow question, would be great to get some hints for the implementation.
http://stackoverflow.com/questions/38736366/how-do-i-async-load-a-component-with-asyncroute-in-webpack
Best regards
westor