i\'m trying to make a custom filter pipe by following this link, but i got error that said Angular, TypeError: Cannot read property \'toLowerCase\' of undefined
Is the attribute called 'name' or 'prdName' (the one you used in the template is 'prdName')?
transform(values, args) {
values.filter(
product => product.prdName.toLowerCase().includes(args.toLowerCase())
)
}
try like this :
transform(items: any, term: any): any {
if (term === undefined) return items;
return items.filter(function(Product) {
return Product.prdName.toLowerCase().includes(term.toLowerCase());
})
}