Angular: conditional class with *ngClass

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

    That's the normal structure for ngClass is:

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

    So in your case, just use it like this...

    
    

提交回复
热议问题