While looping API response in accordion menu data missing in Angular4

前端 未结 3 709
野性不改
野性不改 2021-01-25 19:39

I am tying to bind the api response (json) in accordion menu ,Here everything is working fine but in accordion I have category,group and subgroup .

In category there is

3条回答
  •  失恋的感觉
    2021-01-25 20:25

    The problem is that you run *ngFor and set same ids and data-targets. To solve that you can use indexes *ngFor creates in every loop.

    To use them you must assign a template expression to HTML attributes. Example:

    See the working DEMO here

提交回复
热议问题