JavaScript Edu Resources. Angular Courses. React Tutorials. Join us!


Wrapper around cookies/sessionStorage/localStorage for angular2. If all are unavailable will use an in memory storage.

  • Expiry is also implemented for all drivers not just cookies

    With 2.0 this library supports AoT.

  • As a result there was two options, one to create a storage type for each different storage, and two to change and other methods to explicitly use a driver.
  • , , , { }) will work with every driver type You can also use set to pass options for cookies like maxAge and such

    These are the types of drivers available.

  • If you try to set it to a (single) driver that is unsupported it will fallback to the memory driver.
  • To set fallback drivers, pass in an Array of drivers in the order or preference:

    Again, if every driver in Array is unsupported, it will fall back to memory driver.