Skip to content

Commit 330fc3f

Browse files
author
Sebastian Gronewold
committed
Added unwrapping of the jquery encapsulated $document variable
See http://www.bennadel.com/blog/2630-accessing-document-properties-in-angularjs.htm
1 parent d08649f commit 330fc3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

angular-local-storage.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ angularLocalStorage.provider('localStorageService', function() {
7575
// When Angular's $document is not available
7676
if (!$document) {
7777
$document = document;
78+
} else {
79+
// unwrapping the jquery encapsulated document to access cookies
80+
// (see http://www.bennadel.com/blog/2630-accessing-document-properties-in-angularjs.htm)
81+
$document = $document[0];
7882
}
7983

8084
// If there is a prefix set in the config lets use that with an appended period for readability

0 commit comments

Comments
 (0)