AngularJS : Model update detection and change event -


i wonder best way handle change event of input angular. in fact can listen model updates corresponding listeners triggered @ each character entered not when input updates ended.

thanks help. thierry

you can use example inspired of it. it's directive enter :

app.directive('ngenter', function() {         return function(scope, element, attrs) {             element.bind("keydown keypress", function(event) {                 if(event.which === 13) {                     scope.$apply(function(){                         scope.$eval(attrs.onenter);                     });                      event.preventdefault();                 }             });         };     }); 

html :

<div ng-app="" ng-controller="mainctrl">     <input type="text" ng-enter="dosomething()">     </div> 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -