agrublev/angularLocalStorage — pull request #42 by Ornthalas (2014-02-12 13:48:15+00:00)
Title: Add localStorage & sessionStorage factories

I needed to do the same as angularLocalStorage but using sessionStorage.
I thought that instead of creating a new library, I could patch this one to provide the same possibilities but using sessionStorage :)

SessionStorage is the same as localStorage, an object inheriting Storage (see https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage), but with limited persistence (as long as the tab remains opened in the browser).

This PR provides 3 factories instead of one:
* storage
* localStorage
* sessionStorage

The storage service now needs as first argument of each of its methods the storage provider to use ($window.localStorage for example). localStorage and sessionStorage providers are shortcuts that provide the right parameter.

The localStorage service uses $window.localStorage and $cookieStore as a fallback as before.
The sessionStorage service uses only the $window.sessionStorage if available.

I am aware that this PR would break the current API (meaning you would have to inject "localStorage" instead of "storage").
However, I believe that this would be the right way to go in order to handle any kind of storage provider easily and elegantly.