Situation: I need to write a Routing mechanism in Angular for an Application that has more than 1500 pages.
Requirements: I need an Angular-Routing mechanism which is:
- Readable - I shouldn't have to include all my Route-list in my Angular app.
- Scalable - New Routes should also work dynamically.
- Efficient - the initial bundle size should not be large and the routing process should not be slow.
Question: I want to take the Route referenced in Angular-Routing at runtime (dynamically) and render the Component related to that route by lazy-loading it at runtime. How can I achieve this?
I did try lazy-loading with "loadChildren import", but I couldn't do it dynamically in runtime to control which exact component I want to load according to the requested route