In angularjs ng-change = "chk (query)", the call function when a space falls after entering a word

I use the following code to enter user input and search by term

the problem is that if I press any function of a word, it is called, but when I press the space bar, it does not call the function, so I want the user to enter a space, and then the function is called

<input ng-model="query" ng-change="chk(query)" placeholder="Search.."> 

so please can someone suggest me a solution.

thanks

I tried using ng-trim="false" but did not work

+4
source share
1 answer

Make sure you use AngularJS 1.1.1+ to use ng-trim="false" .

Demo: http://jsfiddle.net/SUtfE/

+2
source

All Articles