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

No provider for TreeviewI18n! #19

Closed
wiltonpolesca opened this issue Jul 1, 2017 · 3 comments
Closed

No provider for TreeviewI18n! #19

wiltonpolesca opened this issue Jul 1, 2017 · 3 comments

Comments

@wiltonpolesca
Copy link

I'm following the page instructions to use "ngx-dropdown-treeview" and I've been taking this error:
No provider for TreeviewI18n!

Can someone help me?

Thanks.

@Nelladel
Copy link

Nelladel commented Jul 6, 2017

Add the following to your appropriate module:

Import section:

import {
    TreeviewModule,
    DropdownTreeviewComponent,
    TreeviewConfig,
    TreeviewI18nDefault,
    TreeviewI18n,
    DefaultTreeviewEventParser,
    TreeviewEventParser
} from "ngx-treeview";

and in the provider declaration:

providers: [
        TreeviewConfig,
        { provide: TreeviewI18n, useClass: TreeviewI18nDefault },
        { provide: TreeviewEventParser, useClass: DefaultTreeviewEventParser }
    ]

If you only add the TreeviewI18n provider, you'll probably get the TreeviewEventParser error too.

Hope that does it for you.

@manumqln
Copy link

manumqln commented Jul 9, 2017

Use TreeviewModule.forRoot() instead of TreeviewModule in the imports in module.ts.

@lcnvdl
Copy link

lcnvdl commented Oct 28, 2020

Use TreeviewModule.forRoot() instead of TreeviewModule in the imports in module.ts.

Hi! I'm using TreeviewModule.forRoot() but I'm having this problem

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

5 participants