I have an HTML element as bellow
<div *ngFor="let item of items"> <input type='number' [min]="getMinData(param1,param2)" /> </div> inside ts file
getMinData(rules: ConstraintRule[], id: string) { rules.forEach((rule) => { rule._metadata.productList.forEach((product: SProduct) => { product.OptionGroups.forEach((optionGroup: SProductOptionGroup) => { optionGroup.Options.forEach((option: SProductOptionComponent) => { if (option.ComponentProductId == id) { return option.MinQuantity; } }); }); }); }); } Also, there's no any API call or any other thing, it's just filtration over the local data.
But, On HTML correct qty is not returned.
forEachloop, not the function. The functiongetMinDataalways returnsundefined.