Angular 2 : How to dynamcially lazy load node_modules from library package based on requested URL -


lets have different versions of library -

player    |-player1        |-config.json        |-player1.module.ts        |-player1.component.ts    |-player2        |-config.json        |-player2.module.ts        |-player2.component.ts 

how can load player1 version of library if requested url xyz.com/p1 , player2 xyz.com/p2.

i have multiple versions of library installed in node_modules. based on requested url need lazily load required library version. can routing each version huge chunk when versions build more 20, have route each version. looking better solution.

check tutorial https://angular-2-training-book.rangle.io/handout/modules/lazy-loading-module.html

basically must define routes this

{path : 'p1', loadchildren: 'pathtomodule#modulename'} 

Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -