I'm creating an Angular 13
app that has multiple components that can match the same URL although they would render different content (as in different components) based on the URL value. Thus I can have, like I do in Angular 9 same route paths different components 's answer: https://stackoverflow.com/a/63522451/5293466 I create like a "selector" component that performs the logic and then decides which component should be viewed. That's all fine however this approach - as far as I know - can't handle lazy loading.
I would like to know if I am able to call a component within a component and lazy load the module of it . Is that something achievable? Otherwise how would you handle the scenario where you can have many routes such as /:id/:cityId
, /:id/:townId
, /:id/:regionId
, /:id/:countryId
, etc, etc where you can have a growing list of possibilities and avoid getting a bigger bundle for that particular module? Does that make sense?