Here is very simple situation but I really do not have idea why it's not working. I got input text field that should call function on keyup event. But it's not.
<input class="form-control m-1" type="text" #search (keyup)="filterCatalogues(search.value)">
And the code itself.
filterCatalogues(value: string): CataloguesListDto[] {
return this.catalogues.filter (catalogue => {
return catalogue.companyName === value || catalogue.catalogueName === value;
});
}
You need to change your filterCatalogues event. I have assumed that catalogues is bound to the dom
<input class="form-control m-1" type="text" #search (keyup)="filterCatalogues()">
filterCatalogues(){
this.catalogues = this.catalogues.filter (catalogue => {
return catalogue.companyName === searchModel|| catalogue.catalogueName === searchModel;
});
}