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
Post a Comment