user3407039
user3407039

Reputation: 1335

AngularJS: Force loss of focus

I need to be able to force everything on the page to lose focus at a certain point when the user is editing some items.

I found this solution apparently works using jquery - $(':focus').blur()

Is there a way i can do something similar using angular?

Upvotes: 6

Views: 5421

Answers (1)

Sulthan
Sulthan

Reputation: 130102

Along the lines of

var activeElement = document.activeElement;

if (activeElement) {
   activeElement.blur();
}

This is not really angular, it's pure DOM and javascript.

Upvotes: 10

Related Questions