I search how I can use lazy load module on an angular cli project. On the angular router page, I see this information :
Angular provides a built-in module loader that supports SystemJS to load modules asynchronously. If you were using another bundling tool, such as Webpack, you would use the Webpack mechanism for asynchronously loading modules.
I tried many things but in angular cli project, i'm not able to do working. Do you have an example or a documentation link to enable this feature.
Thanks
Thanks
I use angular cli version 1.0.0.BETA-24
Check this example:
https://github.com/meligy/routing-angular-cli
Let's imagine we have the route lazy, and we want to lazy load it, we create a route entry that looks like this:
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' }
You might need to restart ng serve for this to work, but you should find an extra bundle file generated, and the child bundles in the LazyModule should just work.
Closing as answered.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Check this example:
https://github.com/meligy/routing-angular-cli
Let's imagine we have the route
lazy, and we want to lazy load it, we create a route entry that looks like this:You might need to restart
ng servefor this to work, but you should find an extra bundle file generated, and the child bundles in theLazyModuleshould just work.