Skip to content

Instantly share code, notes, and snippets.

@EpokK
Last active December 18, 2015 13:09
Show Gist options
  • Save EpokK/5787597 to your computer and use it in GitHub Desktop.
Save EpokK/5787597 to your computer and use it in GitHub Desktop.
Directives AngularJS : ngBlur
myApp.directive('ngBlur', function() {
return function( scope, elem, attrs ) {
elem.bind('blur', function() {
scope.$apply(attrs.ngBlur);
});
};
});
@georgeslegros
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment