We have a SPA application written in Angular that uses dynamic loading routes (as opposed to statically defined routes).
Over time, the number of these dynamically loaded user interface components will grow and grow. For any particular client deployment, we will use only a small subset of the possible components. At run time, the list of components will be data driven. Therefore, I want to take this list of components and do the following: - determine the application route for each component at runtime - lazy loading of this component
This is a problem that was solved in the version of our Angular 1 application (using the ocLazyLoad package and angular s $ stateProvider)
It seems to be solvable in some later beta versions of Angular2 (using AsyncRoutes and the router.config method - see the technique here )
But in RC1, that AsyncRoutes and the router.config method seem to be broken.
I can find very little regarding instructions for loading components / routes asynchronously in Angular2 release candidates.
Is there a canonical example for this with the latest candidates?
source share