Skip to content

Commit 65585a2

Browse files
committed
$cookie factory fn should not run $eval
1 parent edbe9d8 commit 65585a2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/service/cookies.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ angularServiceInject('$cookies', function($browser) {
1616
var rootScope = this,
1717
cookies = {},
1818
lastCookies = {},
19-
lastBrowserCookies;
19+
lastBrowserCookies,
20+
runEval = false;
2021

2122
//creates a poller fn that copies all cookies from the $browser to service & inits the service
2223
$browser.addPollFn(function() {
@@ -25,10 +26,12 @@ angularServiceInject('$cookies', function($browser) {
2526
lastBrowserCookies = currentCookies;
2627
copy(currentCookies, lastCookies);
2728
copy(currentCookies, cookies);
28-
rootScope.$eval();
29+
if (runEval) rootScope.$eval();
2930
}
3031
})();
3132

33+
runEval = true;
34+
3235
//at the end of each eval, push cookies
3336
//TODO: this should happen before the "delayed" watches fire, because if some cookies are not
3437
// strings or browser refuses to store some cookies, we update the model in the push fn.

0 commit comments

Comments
 (0)