Check for document being in [0] key of $document

I have a factory that calls localStorageService.cookie.clearAll() which throws an error of `TypeError: Cannot read property 'split' of undefined`.  It turns out that this error is caused by $document having document be in `$document[0]`.  The proposed update solves my issue; thanks!
revert-117-master
Beshoy Girgis 10 years ago
parent d08649f426
commit 7ac1e52905

@ -75,6 +75,8 @@ angularLocalStorage.provider('localStorageService', function() {
// When Angular's $document is not available
if (!$document) {
$document = document;
} else if ($document[0]) {
$document = $document[0];
}
// If there is a prefix set in the config lets use that with an appended period for readability