Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gsklee/ngStorage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: mediaclip/ngStorage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 19, 2016

  1. Copy the full SHA
    51520c4 View commit details

Commits on Feb 22, 2016

  1. Don't crash when trying to save into local storage and no space is av…

    …ailable
    Julien Bier committed Feb 22, 2016
    Copy the full SHA
    c3bc937 View commit details
Showing with 12 additions and 5 deletions.
  1. +2 −1 Gruntfile.js
  2. +7 −2 ngStorage.js
  3. +1 −1 ngStorage.min.js
  4. +2 −1 package.json
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@ module.exports = function(grunt) {
'components/angular-mocks/angular-mocks.js',
'components/chai/chai.js',
'ngStorage.js',
'test/spec.js'
'test/spec.js',
'node_modules/phantomjs-polyfill/bind-polyfill.js'
]
},

9 changes: 7 additions & 2 deletions ngStorage.js
Original file line number Diff line number Diff line change
@@ -166,8 +166,13 @@
temp$storage = angular.copy(_last$storage);
angular.forEach($storage, function(v, k) {
if (angular.isDefined(v) && '$' !== k[0]) {
webStorage.setItem(storageKeyPrefix + k, serializer(v));
delete temp$storage[k];
try {
webStorage.setItem(storageKeyPrefix + k, serializer(v));
} catch (e) {
$log.warn(e);
} finally {
delete temp$storage[k];
}
}
});

2 changes: 1 addition & 1 deletion ngStorage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,8 @@
"karma-mocha": "^0.2.0",
"karma-phantomjs-launcher": "^0.2.0",
"mocha": "^2.2.4",
"phantomjs": "^1.9.17"
"phantomjs": "^1.9.17",
"phantomjs-polyfill": "0.0.1"
},
"dependencies": {}
}