diff options
| -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. |
