<div class="collapse in " [ngClass]="(active_tab=='assignservice' || active_tab=='manage')?'show':''" id="collapseExampleOrganization" aria-expanded="true" style=""><ul> <li class="nav-item" [ngClass]="{'active': active_tab=='manage'}"><a routerLink="/main/organization/manage" (click)="activemenu('manage')"> <i class="la la-building-o"></i><p>Manage</p></a></li> <li class="nav-item" [ngClass]="{'active': active_tab=='assignservice'}"><a routerLink="/main/organization/assignservice" (click)="activemenu('assignservice')"><i class="la la-user"></i><p>Add organization</p></a></li></ul></div>
Code is good example of ngClass if else condition.
[ngClass]="(active_tab=='assignservice' || active_tab=='manage')?'show':''"[ngClass]="{'active': active_tab=='assignservice'}"