I have an array of person objects that I displayed in HTML using ngFor Angular 5.
persons:Array<Person>=[];
the Person objects contains an Array of Role object described as below:
export class Role{
id:string
label:string;
}
export class Person{
// many attributes
roles:Array<Person>;
}
In the HTML i am using ngFor to fetch the persons Array in div tag. and I want to get string separated comma of the roles's label for each person and display it in div.
I want something like that:
<div *ngFor='let person of persons'>
<p> {{ person.roles.label.join(',') }} </p>
</div>
Thanks for help