Skip to content

Commit

Permalink
Merge pull request #8 from dcendents/ieFix
Browse files Browse the repository at this point in the history
Bugfix for IE9 where accessing a Web Storage key index that doesn't exist will cause an error
  • Loading branch information
Gias Kay Lee committed Aug 9, 2013
2 parents 56e7505 + 8b7a7be commit a4a5fdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
_last$storage;

for (var i = 0, k; k = webStorage.key(i); i++) {
for (var i = 0, k; i < webStorage.length && (k = webStorage.key(i)); i++) {
'ngStorage-' === k.slice(0, 10) && ($storage[k.slice(10)] = angular.fromJson(webStorage.getItem(k)));
}

Expand Down

0 comments on commit a4a5fdc

Please sign in to comment.