i have 2 inputs, wanted call function after switching second input. tried ng-change
call function on each value.
can 1 suggest me how call function after switching next input.
<div ng-controller="todoctrl"> <input type="text" ng-model="todotext1" size="30" placeholder="add new todo here"><br> <input type="text" ng-model="todotext2" size="30" placeholder="add new todo here"><br> <input class="btn-primary" type="submit" value="add">
you can call function on ng-blur if want call function leave field or can call function on ng-focus of next input if want call function switch next field
<input type="text" ng-model="todotext1" size="30" placeholder="add new todo here" ng-blur ="myfunction()"> <input type="text" ng-model="todotext2" size="30" placeholder="add new todo here" ng-focus ="myfunction()">
from 2 choose ng-blur because many time found performance issue on ng-focus
Comments
Post a Comment