Lose focus event in AngularJS


In AngularJS, I can use the ng-focus directive to know when I have the focus of an input field, but what about when I lose the focus?

Is there any directive for that?

Problem courtesy of: JMK


The opposite of the focus event is the blur event. It's fired when an element loses its focus. So what you are looking for is the ngBlur directive.

Solution courtesy of: zeroflagL


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.