diff options
| author | Lucas Galfasó | 2013-08-12 10:53:31 -0300 | 
|---|---|---|
| committer | Brian Ford | 2013-10-02 11:10:29 -0700 | 
| commit | 10cc1a42c925749f88433546d41d35ba07a88e6f (patch) | |
| tree | 6af4ceeb959dd8275fbc2e3efb766b016767c306 /src/ng/rootScope.js | |
| parent | 40414827f42c8fb86abb835f7387d5b02923d532 (diff) | |
| download | angular.js-10cc1a42c925749f88433546d41d35ba07a88e6f.tar.bz2 | |
fix($scope): $evalAsync executes on the right scope
Executes $evalAsync at the scope that the call was made
Closes: #3548
Diffstat (limited to 'src/ng/rootScope.js')
| -rw-r--r-- | src/ng/rootScope.js | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 8f9be5e6..32142b38 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -501,7 +501,7 @@ function $RootScopeProvider(){              dirty, ttl = TTL,              next, current, target = this,              watchLog = [], -            logIdx, logMsg; +            logIdx, logMsg, asyncTask;          beginPhase('$digest'); @@ -511,7 +511,8 @@ function $RootScopeProvider(){            while(asyncQueue.length) {              try { -              current.$eval(asyncQueue.shift()); +              asyncTask = asyncQueue.shift(); +              asyncTask.scope.$eval(asyncTask.expression);              } catch (e) {                $exceptionHandler(e);              } @@ -704,7 +705,7 @@ function $RootScopeProvider(){            });          } -        this.$$asyncQueue.push(expr); +        this.$$asyncQueue.push({scope: this, expression: expr});        },        $$postDigest : function(fn) { | 
