{"id":16428789,"url":"https://github.com/netanelbasal/angular2-storage-sync","last_synced_at":"2025-10-26T23:31:05.584Z","repository":{"id":57179733,"uuid":"70050479","full_name":"NetanelBasal/angular2-storage-sync","owner":"NetanelBasal","description":"Angular2 decorator to sync properties automatically from/to LocalStorage or SessionStorage","archived":false,"fork":false,"pushed_at":"2017-10-18T05:54:56.000Z","size":17,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T06:32:43.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetanelBasal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-05T10:29:49.000Z","updated_at":"2019-03-11T01:23:00.000Z","dependencies_parsed_at":"2022-09-14T03:30:50.957Z","dependency_job_id":null,"html_url":"https://github.com/NetanelBasal/angular2-storage-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-storage-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-storage-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-storage-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetanelBasal%2Fangular2-storage-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetanelBasal","download_url":"https://codeload.github.com/NetanelBasal/angular2-storage-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238408714,"owners_count":19467168,"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-10-11T08:18:59.407Z","updated_at":"2025-10-26T23:31:00.299Z","avatar_url":"https://github.com/NetanelBasal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated! Do Not Use!\n\n### Angular2 Storage Sync\n\nThe Angular2 Storage Sync is an Angular2 decorator to sync properties automatically from/to LocalStorage or SessionStorage.\n\n#### Use\n\n1. `cd` to the root of your app and run `npm install --save angular2-storage-sync`\nOR add `\"angular2-storage-sync\": \"^0.1.0\"` to your package.json file and then `cd` to the root of your app and run `npm install`\n\n2. Use in your component or service:\n```typescript\nimport { StorageSync, StorageStrategy } from 'angular2-storage-sync';\n\nexport class AppComponent {\n @StorageSync('rememberMe') remember: boolean = false;\n @StorageSync(null, StorageStrategy.Session) items: Array\u003cObject\u003e = [];\n}\n```\n\n##### The @StorageSync decorator expects two params:\n1. Custom key - the default is the property name.\n2. StorageStrategy - Local or Session - defaults to LocalStorage.\n\n**Important**: \nAlways define a default value for the properties you are using in the `@StorageSync` lines.\n\n\n##### Example\n\n```javascript\n@Component({\n  selector: 'storage-app',\n  template: \n    \u003cinput type=\"checkbox\"  [(ngModel)]=\"remember\"\u003e Remember me\n    \u003cbutton (click)=\"setItems()\"\u003eSet items\u003c/button\u003e\n    \u003cul\u003e\n      \u003cli *ngFor=\"let item of items\"\u003e\n       {{item.id}}\n      \u003c/li\u003e\n    \u003c/ul\u003e\n})\n\nexport class AppComponent {\n  @StorageSync('rememberMe') remember: boolean = false;\n  \n  @StorageSync(null, StorageStrategy.Session) items: Array\u003cObject\u003e = [];\n\n  setItems() {\n    // To store data, set this.items (the variable of type Array\u003cObject\u003e in your @StorageSync call)\n    //equal to whatever you want to store in local storage.\n    this.items = [{id: 1}, {id: 2}];\n  }\n}\n``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetanelbasal%2Fangular2-storage-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetanelbasal%2Fangular2-storage-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetanelbasal%2Fangular2-storage-sync/lists"}