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

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

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