Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular click add class active and remove from others

<ul id="grouplist" class="list-group">
     <li class="list-group-item" [ngClass]="{'active': selectedItem == item}" (click)="listClick($event, item)" *ngFor="let item of groups">
        {{ item.name }}
     </li>
</ul>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #click #add #class #active #remove
ADD COMMENT
Topic
Name
3+5 =