Angular: conditional class with *ngClass

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

    ngClass syntax:

    [ngClass]="{'classname' : conditionFlag}"
    

    You can use like this:

    
    

提交回复
热议问题