I am making a dynamic permissions list, how would I go about using the "item" from:
<div *ngFor="let item of PermissionsList.T1">
<!-- Some code here -->
</div>
in a inner ngFor
loop. I have tried the following, and other similar variations:
<p *ngFor="let item2 of PermissionsList.{{item}}">test</p>
The PermissionsList
example is like this:
T1: Array [ "Business", "Recreation", "Vehicles" ]
Recreation: Array [ "Hunting", "Leisure" ]
Hunting: Array [ "Big_Game", "Bird", "Pest" ]
Big_Game: Array [ "Moose", "Elk" ]
Pest: Array [ "Wild Boar", "Fox" ]
Bird: Array [ "Geese", "Sharp-tailed grouse" ]
Leisure: Array [ "Hiking", "Bird Watching" ]
Business: Array [ "Trapping", "Utility", "Construction"]
Vehicles: Array [ "Half_ton", "ATV", "SnowMobile" ]
If
PermissionsList
is anArray
ofArrays
and you mean to iterate on the second arrays you can try this:If
PermissionsList
is anObject
ofArrays
and you just want to displayT1
for example, try this: