From 7884dbd8eff1e534e178fc7736cf3b8885a2020b Mon Sep 17 00:00:00 2001 From: Gregory Pike Date: Sat, 15 Feb 2014 16:15:42 -0500 Subject: [PATCH] Fix for error in iPhone --- angular-local-storage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/angular-local-storage.js b/angular-local-storage.js index b96e1fe..e131b39 100644 --- a/angular-local-storage.js +++ b/angular-local-storage.js @@ -70,6 +70,11 @@ angularLocalStorage.provider('localStorageService', function() { var storageType = this.storageType; var webStorage = $window[storageType]; + // When Angular's $document is not available + if (!$document) { + $document = document; + } + // If there is a prefix set in the config lets use that with an appended period for readability if (prefix.substr(-1) !== '.') { prefix = !!prefix ? prefix + '.' : '';