ngStorage icon indicating copy to clipboard operation
ngStorage copied to clipboard

Reset storage variables to default values

Open artemjackson opened this issue 8 years ago • 3 comments

It would be great to have ability to reset ngStorage variables to their default values

artemjackson avatar Sep 04 '15 10:09 artemjackson

Hey!

Could you provide an example use case?

// Setup
$scope.$storage = $localStorage.$default({
    counter: 42
});

$scope.$storage.counter = 142;

$scope.$storage.$reset();
// Now the counter is 42 again.

Something like this you would like ?

egilkh avatar Sep 04 '15 10:09 egilkh

yep, exactly it could be $resetDefaults() method or something like this

artemjackson avatar Sep 04 '15 10:09 artemjackson

This would have been exactly, what I needed.

Firzenizer avatar Nov 29 '17 08:11 Firzenizer