Does someone knows how to get the following working:
If an user clicks inside \"name\" - Set CSS Class to XYZ on DIV ?
E
Working example for pre-1.2.xxx versions: http://jsfiddle.net/atXAC/
In this example, the ng-customblur directive will fire a function() in your controller.
HTML:
Enter your Name here
JS:
myApp.directive('ngCustomblur', ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr['ngCustomblur']);
element.bind('blur', function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
});
});
}
}]);
function MyCtrl($scope) {
$scope.onBlur = function(){
$scope.hasFocus = false;
}
}