In my code, I have defined an interface as follows:
export interface OurHistory {
ourHistory?: object;
step1?:object;
step2?:object;
}
Within the HistoryComponent class, I am doing the following:
export class HistoryComponent implements OnInit, OnDestroy {
myHistory:OurHistory;
let ourHistory = [];
ourHistory = this.allHistory.fields['ourHistory'];
this.myHistory.ourHistory = ourHistory[0];
}
However, I encounter an error message that says "Cannot set property 'ourHistory' of undefined"