angular - Change button color on click inside ngFor -
i generating segment buttons conditionally, how can change button color clicked:
<ion-segment *ngif="menu" [(ngmodel)]="apps"> <ion-segment-button *ngfor="let item of menu; let = index" value="{{item .key}}" [ngclass]="{active: === activeindex}" (click)="changetab(item.key); setactiveindex(i)" style="display:block;" > {{item?.name}} </ion-segment-button> </ion-segment>
if apply [ngstyle]="{'background-color': this.buttoncolor}"
on ion-segment-button
reflect on button, want change color of clicked one
Comments
Post a Comment