ngBlur and ngFocus are now in Angular

This commit is contained in:
Colin Frei 2013-09-23 19:35:47 +02:00
parent e4843db27e
commit 457da3dff1

View file

@ -139,24 +139,4 @@ angular.module('podcast.directives', [])
}
};
})
.directive('ngFocus', ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr['ngFocus']);
element.bind('focus', function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
});
});
}
}])
.directive('ngBlur', ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr['ngBlur']);
element.bind('blur', function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
});
});
}
}])
;