Open viros opened 6 years ago
I am having the same issue. Would be nice to have a solution for that.
You can resolve this issue by adding {providedIn :'root'} inside Injectable decorator your code will be like this : @Injectable({providedIn :'root'})
I have an app.component registered in app.module. Inside this component i use mc-breadcrumbs component. i have lazy module 'lazy.module' that has it's own routing configuration. Here i'm using custom breadcrumb resolver inherited from McBreadcrumbsResolver. CustomMcBreadcrumbsResolver added to providers for 'lazy.module'.
With this configuration i see next error:
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[CustomBreadcrumbsResolver]:
If i add CustomBreadcrumbsResolver to app.module the error is gone and it works as expected. The problem, that i don't want to add this service to main module(Angular resolvers work in this way).