Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$evalAsync does not follow $eval semantics, runs on $rootScope, not current Scope #3548

Closed
janv opened this issue Aug 12, 2013 · 0 comments
Closed

Comments

@janv
Copy link

janv commented Aug 12, 2013

Since we have only a single asyncQueue (331cd5a), the call to $evalAsync does not follow the same semantics as the call to $eval.

This is because the scope for an expression in $evalAsync is always the $rootScope, whereas the scope for an $eval expression is always the current scope.

If this is intentional, which I hope it's not, it needs to carry a big fat warning in the docs. A fix could be to store the context alongside the actual expression when adding stuff to the asyncQueue.

I would just like to quickly get a confirmation on this oberservation before trying to submit a patch. I created a failing test to demonstrate the problem.

janv added a commit to janv/angular.js that referenced this issue Aug 12, 2013
lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Aug 12, 2013
Executes $evalAsync at the scope that the call was made

Closes: angular#3548
btford pushed a commit to btford/angular.js that referenced this issue Oct 2, 2013
Executes $evalAsync at the scope that the call was made

Closes: angular#3548
@ghost ghost assigned btford Oct 2, 2013
@btford btford closed this as completed Oct 2, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Executes $evalAsync at the scope that the call was made

Closes: angular#3548
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Executes $evalAsync at the scope that the call was made

Closes: angular#3548
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants