You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
If we'll focus on an element from angular context, and that element has ngFocus, we will get '$apply already in progress' exception. You can see it happen in the following plunkr: http://plnkr.co/edit/R6ZDD8kVGu3SpzHY4CVT?p=preview **
Focusing and blurring with the cursor works fine, like it should. However when clicking on the 'Click to focus on input' button, we will get the exception (see console).
This issue can be solved in the directives of ngFocus, ngBlur and the rest of the events by checking if digest is already in progress (scope.$root.$$phase). However, I don't think that checking digest state on a plain directive is the 'angular way' of doing things, so maybe I'm missing something here. If you do think it's the way to do it, I don't mind writing it.
** I know that fiddling with DOM on the controller is bad practice, it's just to keep the example simple, it can be easily reproduced on a better-practice directive with an ngClick handler that does the same thing.
The text was updated successfully, but these errors were encountered:
Hi,
If we'll focus on an element from angular context, and that element has ngFocus, we will get '$apply already in progress' exception. You can see it happen in the following plunkr:
http://plnkr.co/edit/R6ZDD8kVGu3SpzHY4CVT?p=preview **
Focusing and blurring with the cursor works fine, like it should. However when clicking on the 'Click to focus on input' button, we will get the exception (see console).
This issue can be solved in the directives of ngFocus, ngBlur and the rest of the events by checking if digest is already in progress (scope.$root.$$phase). However, I don't think that checking digest state on a plain directive is the 'angular way' of doing things, so maybe I'm missing something here. If you do think it's the way to do it, I don't mind writing it.
** I know that fiddling with DOM on the controller is bad practice, it's just to keep the example simple, it can be easily reproduced on a better-practice directive with an ngClick handler that does the same thing.
The text was updated successfully, but these errors were encountered: