forked from agrublev/angularLocalStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams.json
More file actions
1 lines (1 loc) · 2.81 KB
/
Copy pathparams.json
File metadata and controls
1 lines (1 loc) · 2.81 KB
1
{"name":"Angular localStorage ","tagline":"The simplest localStorage implementation you will ever use.","body":"Angular-localStorage [](https://travis-ci.org/agrublev/Angular-localStorage)\r\n====================\r\n\r\nThe simpliest localStorage module you will ever use. Allowing you to set, get, and *bind* variables.\r\n\r\n## Features:\r\n\r\n* Two way bind your $scope variable value to a localStorage key/pair which will be updated whenever the model is updated.\r\n* You can directly store Objects, Arrays, Floats, Booleans, and Strings. No need to convert your javascript values from strings.\r\n* Fallback to Angular ``$cookies`` if localStorage is not supported (REMEMBER to add ``angular-cookies.min.js`` script to your project or remove ``'ngCookies'`` from a dependency);\r\n\r\n## How to use\r\n\r\n1. Just add this module to your app as a dependency\r\n``var yourApp = angular.module('yourApp', [..., 'localStorage']``\r\n2. Now inside your controllers simply pass the $store factory like this\r\n``yourApp.controller('yourController', function( $scope, $store){``\r\n3. Using the ``$store`` factory\r\n ```\r\n // binding it to a $scope.variable\r\n $store.bind($scope,'varName','someDefaultValue');\r\n // the params are ($scope, varName, defaultValue(optional))\r\n // $scope - pass a reference to whatever scope the variable resides in\r\n // varName - the variable name so for $scope.firstName enter 'firstName'\r\n // defaultValue - if you want to set a default value if there is no localStorage value so that the first time you initiate it the value is assigned\r\n\r\n // will constantly be updating $scope.viewType\r\n // to change the variable both locally in your controller and in localStorage just do\r\n $scope.viewType = 'ANYTHING';\r\n // that's it, it will be updated in localStorage\r\n\r\n // just storing something in localStorage with cookie backup for unsupported browsers\r\n $store.set('key','value');\r\n // getting that value\r\n $store.get('key');\r\n ```\r\n\r\n## Bower\r\nThis module is available as bower package, install it with this command:\r\n\r\n```bash\r\nbower install angular-localStorage\r\n```\r\n\r\nor\r\n\r\n```bash\r\nbower install git://github.com/agrublev/Angular-localStorage.git\r\n```\r\n\r\n## Contributors\r\nThe repository is maintained by Angel Grablev (agrublev). Special thanks to:\r\n* ThomasWeiser \r\n* Elexy \r\n* voronianski\r\n* DevinClark\r\n\r\n\r\n## Example\r\n\r\nFor live example please checkout - http://plnkr.co/edit/Y1mrNVRkInCItqvZXtto?p=preview\r\n\r\n## Suggestions?\r\n\r\nPlease add an issue with ideas, improvements, or bugs! Thanks!\r\n\r\n---\r\n\r\n(c) 2013 MIT License","google":"UA-677733-17","note":"Don't delete this file! It's used internally to help with page regeneration."}