Seeking help with a code issue
Any advice on best practices would be greatly appreciated. Thank you!
An error has occurred: TypeError: Cannot read property 'process' of undefined
myComponent.ts
ProcessInfo: any | false;
showSaveItems = () => {
this.typeCategory = [];
this.dataTypesLoop = [];
if (this.ProcessInfo.process.data.mortgage.length) {
for (let i = 0; i < this.ProcessInfo.process.data.mortgage.length; i++) {
if (this.ProcessInfo.process.data.mortgage[i].mortgageHeader !== null) {
const findItem = this.categories.find(
obj =>
obj.value ==
this.ProcessInfo.process.data.mortgage[i].mortgageHeader.category
);
}
}
}
this.dataTypes = new Set(this.dataTypesLoop);
return new Set(this.typeCategory);
};
myComponent.html
<li *ngFor="let item of showSaveItems()">
<strong>{{ item.text }}</strong>
</li>