Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
spongessuck474957dIs it lazy loaded?
You either have lazyload or conflicting provider problems. This is the main reason the common recommendation is "services go in core, core is injected to the app root." You're getting a duplicate token due to the service being explicitly or eagerly provided twice.
Use the forRoot pattern as seen in Router to sidestep this:
The other in place option is to write a guarded service that injects a di instance of itself. If injected !== this -> complain loudly.
hitko146157dIf your service uses dependencies, then it will be reinstantiated whenever providers for those dependencies change.
A depends on B depends on C, and they're all provided in root. However, if some module provides C, all three services will be reinstantiated for that module.