localstorage: Correctly check whether value is set before setting default

The old condition always overwrote boolean values that were set to false
with the default m( Check for undefined instead.
This commit is contained in:
Lorenz Hübschle-Schneider 2014-02-21 10:50:29 +00:00
parent df1bb08749
commit fb9d5af5fc

View file

@ -98,7 +98,7 @@ ls.factory("$store",function($parse){
*/
bind: function ($scope, key, def) {
def = def || '';
if (!publicMethods.get(key)) {
if (publicMethods.get(key) === undefined) {
publicMethods.set(key, def);
}
$parse(key).assign($scope, publicMethods.get(key));