JMK
JMK

Reputation: 28059

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?

Upvotes: 25

Views: 31764

Answers (1)

a better oliver
a better oliver

Reputation: 26828

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.

Upvotes: 45

Related Questions