I think, you did not declare applyFilter()
function in the TS file. I have used the exactly the same HTML and I have used applyFilter()
function like below=>
applyFilter(data){
console.log(data);
}
and in console, it is showing the result. On the other hand hand, if you still facing the problem with (keyup)
you can use (input)
too. After trying all of them, if you still face problem then check the app.module.ts
file and find FormsModule
is imported or not.
Note: 1.
Code for (keyup)
Stackblitz
Demo.
Code for (input)
Stackblitz
Demo.