Answers for "angular onclick toggle class"

3

angular onclick toggle class

// component.ts
toggleClass: boolean = false;

// component.html
<button (click)="toggleClass = !toggleClass" [ngClass]="{ 'button--grey': !toggleClass }">
  Confirm
</button>
Posted by: Guest on January-28-2021
0

angular ng-click toggle class

$scope.toggle = false;


<button id="btn" ng-click="toggle = !toggle" ng-class="{'red' : toggle}">Change Class</button>
Posted by: Guest on June-08-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language