for Reactive forms -
HTML file
<div class="col-sm-2">_x000D_
<button type="button" [class]= "btn_class" id="b1" (click)="changeMe()">{{ btn_label }}</button>_x000D_
</div>
_x000D_
TS file
changeMe() {_x000D_
switch (this.btn_label) {_x000D_
case 'Yes ': this.btn_label = 'Custom' ;_x000D_
this.btn_class = 'btn btn-danger btn-lg btn-block';_x000D_
break;_x000D_
case 'Custom': this.btn_label = ' No ' ;_x000D_
this.btn_class = 'btn btn-success btn-lg btn-block';_x000D_
break;_x000D_
case ' No ': this.btn_label = 'Yes ';_x000D_
this.btn_class = 'btn btn-primary btn-lg btn-block';_x000D_
break;_x000D_
}
_x000D_