what should i do for diplaying the data of company name, because idk why its show undefined. i think i do it in correct way because its object, so what i need is just use "." but when i trying to show company name, data of (name, birthdate,city, etc) are gone but if im trying to showing "element.profile.current_job" its displaying [object OBJECT] and the these (name, birthdate,city, etc) data is still dispalyed.
JSON File
{
"Profile": {
"name": "John",
"birthDate": "2020-07-03 00:00:00.000",
"city": "L.A",
"current_job": {
"companyName": "Company",
"position": {
"positionName": "Manager",
"time": {
"start": "2020-07-03 00:00:00.000",
"till": "2020-07-03 00:00:00.000"
}
}
},
"gender": "Female",
"status": "Single"
}
}
HTML
//1 success show [object OBJECT]
<ng-container matColumnDef="companyName">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Company Name</th>
<td mat-cell *matCellDef="let element">
{{ element.Profile.current_job }}
</td>
</ng-container>
//2 failed "Cannot read property 'companyName' of undefined"
<ng-container matColumnDef="companyName">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Company Name</th>
<td mat-cell *matCellDef="let element">
{{ element.Profile.current_job.companyName }}
</td>
</ng-container>
//3 success show L.A
<ng-container matColumnDef="city">
<th mat-header-cell *matHeaderCellDef mat-sort-header>City</th>
<td mat-cell *matCellDef="let element">
{{ element.Profile.city }}
</td>
</ng-container>