Page 1 of 1

delete from localstorage

Posted: Wed Nov 13, 2013 1:09 am
by Michael4771079

Hi folks,
how can I delete the content of a localstorage variable on success of a service


delete from localstorage

Posted: Wed Nov 13, 2013 1:31 am
by Illya Stepanov

You can set it an empty string value:
pre
localStorage.removeItem("key");
/pre


delete from localstorage

Posted: Wed Nov 13, 2013 1:36 am
by Michael4771079

Sorry lllya,
I meant remove all content completely, so as new service from db can be saved in the localstorage variable


delete from localstorage

Posted: Wed Nov 13, 2013 6:44 am
by Kateryna Grynko

Hi Michael,

A new service just rewrites localStorage values. It's possible to clear all the variables using this code:prelocalStorage.clear();/pre


delete from localstorage

Posted: Thu Mar 19, 2015 2:49 am
by Ellen Schlechter

By "key", do you mean the LSV you want to clear?


delete from localstorage

Posted: Fri Mar 20, 2015 4:42 am
by Yurii Orishchuk

Hi Ellen,

Yes.

Regards.