localStorage.js 430 B

1234567891011121314151617
  1. angular.module('localStorage', []).value('localStorage', localStorage)
  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. function localStorage(...args) {
  8. try {
  9. return $.localStorage(...args)
  10. } catch (e) {
  11. console.error('localStorage exception', e)
  12. return null
  13. }
  14. }
  15. export default localStorage