You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Router: Enable loadChildren to support a function that returns a Promise #9938
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
The loadChildren route config property only accepts a string
Expected/desired behavior
The loadChildren route config property accepts a string or function that returns a promise
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
What is the expected behavior?
What is the motivation / use case for changing the behavior?
In order to allow lazy loading in Webpack 1 with the upcoming @AppModules, there needs to be a way to return a promise that resolves an app module.
It would also be helpful if this support were added to the SystemJsAppModuleLoader so SystemJS and Webpack are supported out of the box.
Please tell us about your environment:
Angular version: 2.0.0-rc.X
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Activity
brandonroberts commentedon Jul 12, 2016
Tested and working with a custom app module loader using a function instead of a string with no changes needed.
matt-psaltis commentedon Aug 10, 2016
Hi @brandonroberts do you have an example of this working in a plnkr or github repo that's compatible with router v3 rc1?
brandonroberts commentedon Aug 10, 2016
I have an example gist here of using a custom loader: https://gist.github.com/brandonroberts/02cc07face25886fe142c4dbd8da1340
angular-automatic-lock-bot commentedon Sep 9, 2019
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.