I have created on-blur
directive for user that blurs out from the input field
<input type="text" on-blur="doSomething({{myObject}})">
myObject looks like:
myObject = {a : foo, b : bar ... }
this is how my directive currently looks like:
myModule.directive('onBlur',function(){
return {
restrict: 'A',
link: function(scope,element,attrs) {
element.bind('blur',function(){
console.log('blurrred');
});
}
}
});
How do I execute the function doSomething({{myObject}}) when the blur event is triggered?
I've tried doing something like this that has failed to work:
...
element.bind('blur',function(){
console.log('blurrred');
doSomething(object);
});
...