Angular 2 lazy loaded module - service not singleton

扶醉桌前 提交于 2019-12-06 04:11:04

I believe this is a known issue, tracked here https://github.com/angular/angular/issues/12869.

Stephanie

I think this is the same problem as this Stackoverflow post: How do I provide a service in a lazy-loaded module and have that service scoped to just the lazy-loaded module and its components?

The solution was to create a "root component" in the lazy loaded module and add the components to this new root component.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!