Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS: Force loss of focus

Tags:

angularjs

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?

like image 384
user3407039 Avatar asked Jul 17 '15 10:07

user3407039


1 Answers

Along the lines of

var activeElement = document.activeElement;

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

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

like image 168
Sulthan Avatar answered Nov 08 '22 09:11

Sulthan