Angular2 ng-bootstrap - no provider error

后端 未结 2 886
执笔经年
执笔经年 2021-01-03 21:48

I am trying to integrate ng bootstrap UI into my Angular 2 project. After following the simple instructions found here: https://ng-bootstrap.github.io/#/getting-started i

相关标签:
2条回答
  • 2021-01-03 21:58

    For anyone else that's getting this error for a different component, e.g ngbDropdown .. make sure you have the ngbDropdown set on the parent element.

    0 讨论(0)
  • 2021-01-03 22:08

    import NgbModule in your app.module.ts like this-

    import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
    

    and add it in imports section of ngmodule-

    @NgModule({
      declarations: [AppComponent, ...],
      imports: [NgbModule.forRoot(), ...],
      bootstrap: [AppComponent]
    })
    

    See if this helps.

    0 讨论(0)
提交回复
热议问题