Navbar drop-down menu not working with Angular and Bootstrap 4

前端 未结 6 2200
暗喜
暗喜 2020-12-17 17:09

I\'m developing a web application with Angular 5 and Bootstrap 4 and I\'m having problems with the nav menu bar dropdowns. I\'m following the documentation https://getbootst

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 17:31

    Additional to app.module.ts, you need to import the module MDBBootstrapModule.forRoot() in the module where you are putting navbar code.

    Example: ../custom.module.ts

    import { MDBBootstrapModule } from 'angular-bootstrap-md';
    ...
    @NgModule({
      imports: [
        CommonModule,
        MDBBootstrapModule.forRoot()
      ],
    ...
    

提交回复
热议问题