{"id":18314309,"url":"https://github.com/agrublev/angularlocalstorage","last_synced_at":"2026-01-11T13:31:26.292Z","repository":{"id":8558353,"uuid":"10183457","full_name":"agrublev/angularLocalStorage","owner":"agrublev","description":"The simplest angular localStorage implementation you will ever use.","archived":false,"fork":false,"pushed_at":"2015-10-08T13:19:55.000Z","size":1653,"stargazers_count":355,"open_issues_count":20,"forks_count":62,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-10-30T01:50:56.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrublev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-20T22:41:20.000Z","updated_at":"2023-08-19T18:17:02.000Z","dependencies_parsed_at":"2022-09-11T15:50:34.905Z","dependency_job_id":null,"html_url":"https://github.com/agrublev/angularLocalStorage","commit_stats":null,"previous_names":["agrublev/angular-localstorage","agrublev/ngstorage"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2FangularLocalStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2FangularLocalStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2FangularLocalStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2FangularLocalStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrublev","download_url":"https://codeload.github.com/agrublev/angularLocalStorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T16:31:40.663Z","updated_at":"2025-12-12T04:25:03.974Z","avatar_url":"https://github.com/agrublev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"angularLocalStorage [![Build Status](https://travis-ci.org/agrublev/angularLocalStorage.svg?branch=master)](https://travis-ci.org/agrublev/angularLocalStorage)\n====================\n\nThe simpliest localStorage module you will ever use. Allowing you to set, get, and *bind* variables.\n\n## Features:\n\n* Two way bind your $scope variable value to a localStorage key/pair which will be updated whenever the model is updated.\n* You can directly store Objects, Arrays, Floats, Booleans, and Strings. No need to convert your javascript values from strings.\n* Fallback to Angular ``$cookieStore`` if localStorage is not supported (REMEMBER to add ``angular-cookies.min.js`` script to your project or remove ``'ngCookies'`` from a dependency);\n\n## How to use\n\n1. Just add this module to your app as a dependency\n``var yourApp = angular.module('yourApp', [..., 'angularLocalStorage']``\n2. Now inside your controllers simply pass the storage factory like this\n``yourApp.controller('yourController', function( $scope, storage){``\n3. Using the ``storage`` factory\n  ```JAVASCRIPT\n  // Note: if the scope variable already exists, it takes precedence over the default and stored values\n  // binding it to a $scope.variable (minimal)\n  storage.bind($scope,'varName');\n  // binding full\n  storage.bind($scope,'varName',{defaultValue: 'randomValue123' ,storeName: 'customStoreKey'});\n  // the params are ($scope, varName, opts(optional))\n  // $scope - pass a reference to whatever scope the variable resides in\n  // varName - the variable name so for $scope.firstName enter 'firstName'\n  // opts - custom options like default value or unique store name\n  // \tHere are the available options you can set:\n  // \t\t* defaultValue: the default value\n  // \t\t* storeName: add a custom store key value instead of using the scope variable name\n\n  // will constantly be updating $scope.viewType\n  // to change the variable both locally in your controller and in localStorage just do\n  $scope.viewType = 'ANYTHING';\n  // that's it, it will be updated in localStorage\n\n  // just storing something in localStorage with cookie backup for unsupported browsers\n  storage.set('key','value');\n  // getting that value\n  storage.get('key');\n\n  // Getting an unset key will return null\n  console.log(storage.get('keyThatIsUndefined')) // null\n  \n  // checking if the cookie fallback is being used right now, so you don't try to store fairly big data in cookies\n  if(!storage.isCookieFallbackActive()) {\n    ...\n  }\n\n  // clear all localStorage values\n  storage.clearAll();\n\n  // gets all the keys in the storage system returned as an array\n  storage.getKeys(); // ['key','key2']\n  ```\n\n## Bower\nThis module is available as bower package, install it with this command:\n\n```bash\nbower install angularLocalStorage\n```\n\nor\n\n```bash\nbower install git://github.com/agrublev/angularLocalStorage.git\n```\n\n## Angular Requirements\n0.3.0 requires AngularJS 1.3.0+.\n\n0.2.0 requires AngularJS 1.2.x.\n\n## Example\n\nFor live example please checkout - http://plnkr.co/edit/PNLjDEaRKtpLgGZMJypk?p=preview\n\n## Suggestions?\n\nPlease add an issue with ideas, improvements, or bugs! Thanks!\n\n---\n\n(c) 2015 MIT License\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrublev%2Fangularlocalstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrublev%2Fangularlocalstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrublev%2Fangularlocalstorage/lists"}