Answer the question
In order to leave comments, you need to log in
Is it possible to hang an event on all inputs in Angular?
There is a large form, depending on what is selected, the content of the page changes.
How to properly hang an on-blur handler on all page inputs to make an ajax request?
Answer the question
In order to leave comments, you need to log in
angular.module('app')
.directive('ngBlurDelegate', function ($parse) {
return {
restrict: 'A',
link: function (scope, el, attr) {
var callback = $parse(attr.ngBlurDelegate);
el.on('blur', function () {
//.. тут что-то делать
callback(scope);
});
}
}
});
<form ng-blur-delegate="callback()">
...
</form>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question