From 330fc3f28b0591ea35bb1bbed29771c1b945c4d5 Mon Sep 17 00:00:00 2001 From: Sebastian Gronewold Date: Tue, 12 Aug 2014 10:15:02 +0000 Subject: [PATCH] Added unwrapping of the jquery encapsulated $document variable See http://www.bennadel.com/blog/2630-accessing-document-properties-in-angularjs.htm --- angular-local-storage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/angular-local-storage.js b/angular-local-storage.js index 0a8ee3f..8ebbe0b 100644 --- a/angular-local-storage.js +++ b/angular-local-storage.js @@ -75,6 +75,10 @@ angularLocalStorage.provider('localStorageService', function() { // When Angular's $document is not available if (!$document) { $document = document; + } else { + // unwrapping the jquery encapsulated document to access cookies + // (see http://www.bennadel.com/blog/2630-accessing-document-properties-in-angularjs.htm) + $document = $document[0]; } // If there is a prefix set in the config lets use that with an appended period for readability