Reputation: 165
I am trying to use the ngb bootstrap on my Angular project. Every components on ngb throws me an error
My package.json
and my app.module.ts
Did I do something wrong? I followed and read the instructions carefully.
Upvotes: 0
Views: 1606
Reputation: 7856
You have to import into the module you are using for the component , Bootstrap Module as it is mentioned in the docs
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
...
imports: [NgbModule, ...],
...
})
export class YourAppModule {
}
It works in this example https://stackblitz.com/edit/angular-d9uwjh?file=src%2Fapp%2Fdatepicker-basic.module.ts
Upvotes: 2
Reputation: 21698
Make sure the module is imported into your module in which the component going to use the Ngb-xx
component. Means if you have a child component which uses Ngb component, include your Ngb module
not in app module but if you are not using shared module, import it in the app module
With the latest version if Ngb-bootstrap
, you need to only import the module which you want to use not the whole module like if you need accordian component, you can only import NgbAccordian
module
Upvotes: 0