Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear $localStorage

Tags:

angularjs

In Angular I tried:

$localStorage.clear();

It got the error:

$localStorage.clear is not a function

What is the correct calling convention to wipe out $localStorage?

like image 694
toddmo Avatar asked Nov 16 '25 04:11

toddmo


1 Answers

As the manual says,

$localStorage.$reset();
like image 117
Estus Flask Avatar answered Nov 18 '25 19:11

Estus Flask



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!