Angular 6 'mat-button-toggle' is not a known element

前端 未结 1 1878
太阳男子
太阳男子 2021-01-12 23:29

I\'ve checked those questions:

  • 'mat-toolbar' is not a known element - Angular 5
  • Jhipster / md-button is not a known element
  • Template
相关标签:
1条回答
  • 2021-01-12 23:52

    mat-button-toggle is available as a part of the MatButtonToggleModule So you'll have to import that as well.

    Add an import statement for the same in your AppModule:

    import {MatButtonToggleModule} from '@angular/material/button-toggle';
    

    And then add it to the imports array as well so that AppModule's templates can understand what mat-button-toggle is.

    Also, I'm not really sure why you've exported these modules from your AppModule. We generally export anything from a module if we are planning on importing that module in some other module. But since this is the AppModule, and thus your RootModule, I don't think you'll be importing it in any other module. That might not be the case though.

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