Skip to content

vskosp/vsHandyStorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Handy linking html form with local or session storage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published