Imagine a scenario with three interfaces structured as follows:
registration-pivot.ts
export interface RegistrationPivot {
THead: RegistrationPivotRow;
TBody: RegistrationPivotRow[];
}
registration-pivot-row.ts
export interface RegistrationPivotRow {
CellList: RegistrationPivotCel[];
}
registration-pivot-cel.ts
export interface RegistrationPivotCel {
content: string;
}
If I fetch data from an API and assign it to the registrationPivot
, how can I access the values in my HTML?
registrationPivot: RegistrationPivot = {} as RegistrationPivot;
searchRegistrationStatistic(){
this.registrationApi.getAllRegistrationStatistic().subscribe(res => {
this.registrationPivot = res;
});
}
- I attempted to use
registrationPivot.THead.CellList
, but that did not work. - I need to iterate through all the Cells within the THead element (as well as TBody), but I am unsure of how to accomplish this. Can someone please provide guidance on how to achieve this? Thank you!