I would like to assign a classes on html based on a property in angular2. That is am trying top open a dropdownlist without use of jquery and bootstrap
So i have
<li
class="dropdown mega-menu mega-menu-wide"
//stuck at adding class of open if propertyval is admin
>
<a #admin class="dropdown-toggle" (click)="toggle(admin)" >Administrative</a>
</li>
in my ts i have
export class ... {
propertyval :null
toggle(val){
this.propertyval = null;
}
}
So now i would like to assign class of open to the list if the value of propertyval is admin else it should be null
How do i go about this