当前位置: 动力学知识库 > 问答 > 编程问答 >

angular2 - Lazy loading module with APP_INITIALIZER

问题描述:

We have an application where we are lazy loading modules via router. We need to load a some resources before the app module starts, but we don't want to use resolve on router. That's why we are trying to create some provider factory (APP_INITIALIZER) to load some data from server and then use it in components in that lazy loaded module. So every module will have some different settings like translations and so on...

I created a plunker for showcase.

https://embed.plnkr.co/uBK23O5cA7QGwlvmbi73/

If you click on lazy it should wait 10 seconds to load the module but its not happening.

We are using angular 2.0.0 version. Thanks for any advice.

分享给朋友:
您可能感兴趣的文章:
随机阅读: