From f95a2420c3ba16f05c08897d2717937ad738f10e Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Thu, 9 Oct 2014 12:59:20 +0300 Subject: [PATCH] Update README.md --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 34ab35b..e188e85 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,35 @@ An Angular module that gives you access to the browsers local storage, **v0.1.1* [![Build Status](https://secure.travis-ci.org/grevory/angular-local-storage.png?branch=master)](https://travis-ci.org/grevory/) +##Table of contents: +- [Configuration](#configuration) + - [setPrefix](#setprefix) + - [setStorageType](setstoragetype) + +##Configuration +###setPrefix +You could set a prefix to avoid overwriting any local storage variables from the rest of your app
+**Default prefix:** `ls.` +```js +myApp.config(function (localStorageServiceProvider) { + localStorageServiceProvider + .setPrefix('yourAppName'); +}); +``` +###setStorageType +You could change web storage type to localStorage or sessionStorage
+**Default storage:** `localStorage` +```js +myApp.config(function (localStorageServiceProvider) { + localStorageServiceProvider + .setStorageType('sessionStorage'); +}); +``` + ##Installation: ```bash -bower install angular-local-storage +$ bower install angular-local-storage ``` Example use: