-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Error: $digest already in progress exception using element.focus in directive #1250
Comments
Not sure that this is a bug in Angular. To get this working, you have to use setTimeout / $timeout service, otherwise you are trying to focus hidden element (the select becomes visible after your .focus() call). Plus .focus() triggers DOM event (synchronously) - so as long as you have some other directive listening on fired even (in this case ui-event listens on blur), it tries to do $apply() within $apply. |
I actually think there should be a way to support this without resolving to On Thu, Sep 13, 2012 at 2:59 AM, Vojta Jina [email protected]:
|
perhaps something like asyncEval but asyncPostDigest On Sun, Sep 16, 2012 at 9:13 PM, Misko Hevery [email protected] wrote:
|
I've been having the same issue, where parent scopes weren't getting updated straight away using $watch until the next time $apply/$digest was called. So I had to resort to using the |
|
Here is a jsfiddle showing the bug
http://jsfiddle.net/jtowell/xK28W/
I was able to get it to work by wrapping in settimeout. Here is working version
http://jsfiddle.net/jtowell/j8hnr/
The text was updated successfully, but these errors were encountered: