mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
$cookie factory fn should not run $eval
This commit is contained in:
parent
edbe9d8ca8
commit
65585a2d3c
1 changed files with 5 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue