Set focus on element
Modify the show search method like this
Modify the show search method like this
The error was caused by this line: This is the correct line: Here is the working example. When you use ngModel within the form tag you also need to provide value for the “name” attribute.