Jason Tree Jason Tree - 2 months ago 23
AngularJS Question

Angular react on model changes

How would you react on model changes to trigger some further action? For instance, say you have an input text field called email and you want to trigger or execute some code as soon as a user starts to type in their email.

HTML Markup:

<input type="email" ng-model="app.email">


CTRL:

.controller('controller', function ($scope) {

});

Answer
<input ng-change="myFunction()" type="email" ng-model="app.email">