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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -