localStorage.js 384 B

12345678910111213
  1. angular.module('localStorage', []).value('localStorage', function(...args) {
  2. /*
  3. localStorage can throw browser exceptions, for example if it is full
  4. We don't use localStorage for anything critical, on in that case just
  5. fail gracefully.
  6. */
  7. try {
  8. return $.localStorage(...args)
  9. } catch (e) {
  10. console.error('localStorage exception', e)
  11. return null
  12. }
  13. })