Angular: conditional class with *ngClass

后端 未结 19 1977
醉话见心
醉话见心 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:36

    Code is good example of ngClass if else condition.

    [ngClass]="(active_tab=='assignservice' || active_tab=='manage')?'show':''"
    
    [ngClass]="{'active': active_tab=='assignservice'}"
    

提交回复
热议问题