Hi,
I am trying to make a list appear or disappear on button click. It (obviously) not working. Any help?
<div *ngFor="#item1 of ListOfItem" >
<div *ngIf=" item1.listofitem > 0 " >
<button ng-click="Collapsable = !Collapsable" > Nombre de lettre {{item1.title}}</button>
<ul ng-class="Collapsable ? '' : 'collapseditem'">
<li *ngFor="#theItem of item1.listofitem">{{theItem}}</li>
</ul>
</div>
</div>
And I declare a “Collapsable” boolean in my ts file.
public Collapsable :boolean;
The css:
.collapseditem{
line-height: 0;
background-color: red;
}