user1650978 user1650978 - 10 months ago 65
Javascript Question

AngularJS - call function after text field completion

I have a text field as

<input type="text" class="form-control" id="inputID" name="inputName" ng-model="inputUserName" ng-required="true" autofocus="true"/>

Once I input the text value and say, press Tab, or move on to the next field, I want to call a function which basically takes the input value and sends it to my server API to perform a validity check. How can I achieve this?


use the ng-blur:

<input type="text" ng-blur="method()">