I have from the server the following structure (as appropriate JSON structure)
Orga1
| + Department1
| | + Role1
| | + Role2
| + Department2
| | + Role10
| | + Role11
Orga 2
| + DepartmentAB
| | + RoleAB1
...
I was thinking to have in an object in Angular like
export interface Organization {
name: string;
lstDeparments: Department [];
}
export interface Department {
name: string;
lstRoles: string [];
}
But somehow I have no real clue how to set up the matching interface in Angular. Because the attribute name is dynamically changing (e.g. Orga1, Orga2) and the list of attributes needs to be filled as well dynamically with the content.
Any ideas how to setup the interface properly? (to have automatic conversion)