-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "angular-local-storage", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"homepage": "http://gregpike.net/demos/angular-local-storage/demo.html", | ||
"authors": [ | ||
"grevory <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* An Angular module that gives you access to the browsers local storage | ||
* @version v0.1.2 - 2014-10-10 | ||
* @version v0.1.3 - 2014-10-14 | ||
* @link https://github.com/grevory/angular-local-storage | ||
* @author grevory <[email protected]> | ||
* @license MIT License, http://www.opensource.org/licenses/MIT | ||
|
@@ -394,11 +394,8 @@ angularLocalStorage.provider('localStorageService', function() { | |
|
||
// Add a listener on scope variable to save its changes to local storage | ||
// Return a function which when called cancels binding | ||
var bindToScope = function(scope, scopeKey, def, lsKey) { | ||
if (!lsKey) { | ||
lsKey = scopeKey; | ||
} | ||
|
||
var bindToScope = function(scope, key, def, lsKey) { | ||
lsKey = lsKey || key; | ||
var value = getFromLocalStorage(lsKey); | ||
|
||
if (value === null && isDefined(def)) { | ||
|
@@ -407,11 +404,11 @@ angularLocalStorage.provider('localStorageService', function() { | |
value = extend(def, value); | ||
} | ||
|
||
$parse(scopeKey).assign(scope, value); | ||
$parse(key).assign(scope, value); | ||
|
||
return scope.$watchCollection(scopeKey, function(newVal) { | ||
return scope.$watch(key, function(newVal) { | ||
addToLocalStorage(lsKey, newVal); | ||
}); | ||
}, isObject(scope[key])); | ||
}; | ||
|
||
// Return localStorageService.length | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters