Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom McBreadcrumbsResolver in lazy loading module #7

Open
viros opened this issue Feb 9, 2018 · 2 comments
Open

Custom McBreadcrumbsResolver in lazy loading module #7

viros opened this issue Feb 9, 2018 · 2 comments

Comments

@viros
Copy link

viros commented Feb 9, 2018

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).

@altso
Copy link

altso commented Aug 13, 2018

I am having the same issue. Would be nice to have a solution for that.

@fakhreddine
Copy link

You can resolve this issue by adding {providedIn :'root'} inside Injectable decorator your code will be like this :
@Injectable({providedIn :'root'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants