I'm attempting to cycle through a list of objects in my Angular/Typescript code, but it's not working as expected. Here is the code snippet:
businessList: RemoteDataSet<BusinessModel>;
businessModel: BusinessModel;
this.businessList.forEach( bl => {
console.log("in foreach");
if (bl.id == this.user.businessId) {
console.log("they are equal");
this.businessModel = bl;
}
else {
console.log("They are not equal");
}
});
Although I have confirmed that businessList contains data (approximately 40 items), the iteration process doesn't seem to execute at all. I'm still fairly new to Angular and Typescript, so I may be overlooking something obvious. Can anyone point out what I might be missing?