angular-local-storage
angular-local-storage copied to clipboard
localStorageService.bind with array
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);