0

I have Angular2 app in which I use lazy loaded modules(ModA and ModB). Initially, ModA would be loaded. On click of a button, user navigates to ModB. There are some dropdowns and checkbox selections that user can make in ModB. Again, user navigates back to ModA. Now if user returns back to ModB, I want to retain all of his dropdowns\checkbox values\selections\state. Is there a way to achieve this by caching\storing the module after first load? I am using AngularCLI.

Deepak
  • 1,038
  • 4
  • 18
  • 31
  • Using a service ? –  May 24 '17 at 09:36
  • Are you looking for `RouteReuseStrategy`? https://stackoverflow.com/questions/41280471/how-to-implement-routereusestrategy-shoulddetach-for-specific-routes-in-angular – yurzui May 24 '17 at 10:04

1 Answers1

0

Use Local Storage , save your values in local storage and retrieve them on next visit its very simple , we have been doing this in our application.

Waleed Mohsin
  • 1,103
  • 1
  • 10
  • 13