- List item:
jsonObject = [
{
place: 'place1',
fatherDetails: [
{name: 'place1_father1', adharId: 134567},
{name: 'place1_father2', adharId: 124567},
],
motherDetails: [
{name: 'place1_mother1', adharId: 123456},
{name: 'place1_mother2', adharId: 123457},
{name: 'place1_mother3', adharId: 123467},
],
},
{
place: 'place2',
fatherDetails: [
{name: 'place2_father1', adharId: 123567},
{name: 'place2_father2', adharId: 12567},
],
motherDetails: [
{name: 'place2_mother1', adharId: 1234567},
{name: 'place2_mother2', adharId: 1234567},
{name: 'place2_mother3', adharId: 1234567},
],
}
];
How do I loop all the fatherDetails objects in HTML with ngFor?
Basically, I require something like this:
<mat-option *ngFor = "let father of jsonObject">
{{father.name}}
</mat-option>
But, this doesn't work. Because, it has to loop twice.
ngFor, if you your basic is not clear referhttps://angular.io/guide/structural-directives.