Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 1.06 KB

README.md

File metadata and controls

32 lines (28 loc) · 1.06 KB

vsHandyStorage

Links data in html form with local or session storage through two directives.

Can also bind several forms with one storage.

vsHandyStorage uses ngStorage module as a dependency.

Install

bower install vs-handy-storage

Usage | Demo

  1. Add vsHandyStorage.js to your index.html

  2. Add module dependency:

angular.module('yourApp', ['vsHandyStorage']);
  1. Create storage and set its name through the vs-local-storage (or vs-session-storage) directive:
<form vs-local-storage="storageName">
</form>
  1. Bind any form element with created storage through the vs-link-storage directive:
<form vs-local-storage="storageName">
    <input ng-model="name" type="text" name="name" vs-link-storage>
</form>

Important, that the attribute name on the form element matches the field name in the storage. Important, that vs-link-storage directive requires declaration of ng-model directive.