Angular ngClass and click event for toggling class

后端 未结 7 1331
粉色の甜心
粉色の甜心 2020-12-02 18:30

In Angular, I would like to use ngClass and click event to toggle class. I looked through online but some are angular1 and there isn\'t any clear instruction or

7条回答
  •  既然无缘
    2020-12-02 19:04

    If you want to toggle text with a toggle button.

    HTMLfile which is using bootstrap:

    
    

    TS file:

    muteStream() {
       this.status = !this.status;
    }
    

提交回复
热议问题