I have a problem with dropdown list, I don’t understand how to expand the list and hide it. Does anyone have any ideas what needs to be added, preferably without using third-party libraries. My idea was that we have a list, and to the right of each is a button. When you click on the button, a list opens under the list on which the button was clicked
list0 ----- button0 (noclick)
list1 ----- button1 (click)
- list1.1
- list1.2
list3 ----- button3 (noclick)
list4 ----- button4 (click)
- list4.1
- list4.2
- list4.3
services.page.html:
<ion-list *ngFor="let e of services">
<ion-item-divider>
<ion-label>{{e.Name}}</ion-label>
</ion-item-divider>
<div *ngIf="e.ListServices != null">
<ion-item *ngFor="let g of e.ListServices">
<ion-label>{{g.Description}}</ion-label>
</ion-item>
</div>
</ion-list>
</ion-content>
JSON:
{
"GuidServicesId":"9647d79b-2b10-4e7d-bd26-199cda4da4aa",
"Name":"asd",
"ListServices":[
]
},
{
"GuidServicesId":"1760d99a-fe30-4573-885f-1e0dabc97c6e",
"Name":"asda",
"ListServices":[
{
"GuidListSevicesId":"9b45ffe1-7a50-430b-b1ba-57d24e4ae877",
"Description":"testlistr",
"consultationRequests":[
],
"ServicesId":"1760d99a-fe30-4573-885f-1e0dabc97c6e"
},
{
"GuidListSevicesId":"fec5b5ca-34ad-41bc-aa1d-a0727d3f48df",
"Description":"asdasdas",
"consultationRequests":[
],
"ServicesId":"1760d99a-fe30-4573-885f-1e0dabc97c6e"
},
]
}
]