diff options
| author | Igor Minar | 2011-02-27 15:54:06 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-02-27 15:54:06 -0800 |
| commit | 65585a2d3c4f73a17d20310de30546116a9a6827 (patch) | |
| tree | 240c471f399e695f67b82530ccd2dac2a5ef40e5 /src | |
| parent | edbe9d8ca8f7963969464eca4e7bb18426f137e5 (diff) | |
| download | angular.js-65585a2d3c4f73a17d20310de30546116a9a6827.tar.bz2 | |
$cookie factory fn should not run $eval
Diffstat (limited to 'src')
| -rw-r--r-- | src/service/cookies.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/service/cookies.js b/src/service/cookies.js index 082b73ab..b8de81c2 100644 --- a/src/service/cookies.js +++ b/src/service/cookies.js @@ -16,7 +16,8 @@ angularServiceInject('$cookies', function($browser) { var rootScope = this, cookies = {}, lastCookies = {}, - lastBrowserCookies; + lastBrowserCookies, + runEval = false; //creates a poller fn that copies all cookies from the $browser to service & inits the service $browser.addPollFn(function() { @@ -25,10 +26,12 @@ angularServiceInject('$cookies', function($browser) { lastBrowserCookies = currentCookies; copy(currentCookies, lastCookies); copy(currentCookies, cookies); - rootScope.$eval(); + if (runEval) rootScope.$eval(); } })(); + runEval = true; + //at the end of each eval, push cookies //TODO: this should happen before the "delayed" watches fire, because if some cookies are not // strings or browser refuses to store some cookies, we update the model in the push fn. |
