1

I want to make a timeout for my Angular 2+ Application . Actually,i want after some time like 20 minutes localtorage got cleared .

Thanks

BenMansourNizar
  • 1,558
  • 4
  • 21
  • 42

1 Answers1

1

You can write setTimeout function with in ngOnInit.

ngOnInit(){

   setTimeout(()=>{
      localStorage.clear();
},time)

}
Tej
  • 195
  • 7