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
. I already imported the pipe to app.module.ts
and also declared it in declaration
. Can anyone help me with this error?
<form id="filter">
<input type="text" class="form-control" name="term" [(ngModel)]="term" placeholder="filter by name" />
</form>
<tr *ngFor="let product of productList | paginate: { itemsPerPage: 1, currentPage: p } | filter: term">
<td>{{product.prdName}}</td>
<td>{{product.prdCat}}</td>
<td>{{product.prdSup}}</td>
</tr>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…