I have an interface declared like this,
export interface OurHistory {
ourHistory?: object;
step1?:object;
step2?:object;
}
Inside the class, I have
export class HistoryComponent implements OnInit, OnDestroy {
myHistory:OurHistory;
let ourHistory = [];
ourHistory = this.allHistory.fields['ourHistory'];
this.myHistory.ourHistory = ourHistory[0];
}
I receive an error saying, Cannot set property 'ourHistory' of undefined