Angular: conditional class with *ngClass

后端 未结 19 1971
醉话见心
醉话见心 2020-11-22 05:21

What is wrong with my Angular code? I am getting:

Cannot read property \'remove\' of undefined at BrowserDomAdapter.removeClass ...

19条回答
  •  灰色年华
    2020-11-22 05:31

    This is what worked for me:

    [ngClass]="{'active': dashboardComponent.selected_menu == 'profile'}"
    

提交回复
热议问题