Last active
December 18, 2015 13:09
-
-
Save EpokK/5787597 to your computer and use it in GitHub Desktop.
Directives AngularJS : ngBlur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myApp.directive('ngBlur', function() { | |
return function( scope, elem, attrs ) { | |
elem.bind('blur', function() { | |
scope.$apply(attrs.ngBlur); | |
}); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any clue why this is executing the function passed in twice?
Debugger shows that $scope.apply is called once but the callback is executed twice.