1

I'm creating an Angular 5 library project where ng-bootstrap is used, and it's working fine when ng serve from its own project folder. Now, it is installed to another Angular 5 app project, and when launching the app, it gives this exception:

    ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[NgbTypeahead -> NgbTypeaheadConfig]: 
  StaticInjectorError(Platform: core)[NgbTypeahead -> NgbTypeaheadConfig]: 
    NullInjectorError: No provider for NgbTypeaheadConfig!
Error: StaticInjectorError(AppModule)[NgbTypeahead -> NgbTypeaheadConfig]: 
  StaticInjectorError(Platform: core)[NgbTypeahead -> NgbTypeaheadConfig]: 
    NullInjectorError: No provider for NgbTypeaheadConfig!

In the library project, I've added NgbModule.forRoot() to app.module.ts, and I also tried to add NgbModule.forRoot() to the app project but it doesn't work. Furthermore, I don't think the dependencies configuration used in library project should be re-declared in the app project.

Please advise on this case. Thank you very much.

1 Answer 1

1

NgbModule.forRoot() should be added in the feature.module.ts in library project instead of app.module.ts. And then reinstall it to the app, it works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.