From c59e98d3eedfb82077794ef89a964c98645b9bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Monteiro?= Date: Sat, 21 May 2016 16:16:41 +0100 Subject: [PATCH] removed get/set (not present in the object);added function;updated test file; (#9356) --- ngstorage/ngstorage-tests.ts | 13 +++++-------- ngstorage/ngstorage.d.ts | 4 +--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ngstorage/ngstorage-tests.ts b/ngstorage/ngstorage-tests.ts index 698723eaa3..e3a427b9b1 100644 --- a/ngstorage/ngstorage-tests.ts +++ b/ngstorage/ngstorage-tests.ts @@ -5,10 +5,6 @@ var app: any; app.controller('LocalCtrl', function ($localStorage: angular.storage.IStorageService) { - $localStorage.set('MyKey', 'value'); - - $localStorage.get('MyKey'); - $localStorage.$default({ counter: 1 }); @@ -20,14 +16,12 @@ app.controller('LocalCtrl', function ($localStorage: angular.storage.IStorageSer $localStorage.$reset(); $localStorage.$apply(); + + $localStorage.$sync(); }); app.controller('SessionCtrl', function ($sessionStorage: angular.storage.IStorageService) { - $sessionStorage.set('MyKey', 'value'); - - $sessionStorage.get('MyKey'); - $sessionStorage.$default({ counter: 1 }); @@ -39,9 +33,12 @@ app.controller('SessionCtrl', function ($sessionStorage: angular.storage.IStorag $sessionStorage.$reset(); $sessionStorage.$apply(); + + $sessionStorage.$sync(); }); app.config(['$localStorageProvider', function ($localStorageProvider: angular.storage.IStorageProvider) { + $localStorageProvider.setKeyPrefix('NewPrefix'); $localStorageProvider.get('MyKey'); diff --git a/ngstorage/ngstorage.d.ts b/ngstorage/ngstorage.d.ts index 0ea372ccb8..d6abea24bf 100644 --- a/ngstorage/ngstorage.d.ts +++ b/ngstorage/ngstorage.d.ts @@ -11,9 +11,7 @@ declare namespace angular.storage { $default(items: {}): IStorageService; $reset(items?: {}): IStorageService; $apply(): void; - - get(key: string): T; - set(key: string, value: T): T; + $sync(): void; } export interface IStorageProvider extends angular.IServiceProvider {