Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localStorageService.bind with array #312

Open
hezo opened this issue Apr 21, 2016 · 0 comments
Open

localStorageService.bind with array #312

hezo opened this issue Apr 21, 2016 · 0 comments

Comments

@hezo
Copy link

hezo commented Apr 21, 2016

binding array to localstorage is overriding stored array with defined array.
localStorageService.bind($scope, 'selections', [{"name": "A", selected: true}, {"name": "B", selected: true }]);

selected values are always true on page refresh, values are succefully being stored in localstorage but value = extend(value, def);on line 401 overrides stored array with the defined one, adding simple array check fixes this for me

if(!Array.isArray(def))
 value = extend(value, def);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant