Angular: conditional class with *ngClass

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

    While I was creating a reactive form, I had to assign 2 types of class on the button. This is how I did it:

    
    

    When the form is valid, button has btn and btn-class (from bootstrap), otherwise just btn class.

提交回复
热议问题