1

I have a route for a component(logger) with some data populated. I want to navigate to a sibling component(details) and when I come back to current component(logger) with the Back button press, I want to restore component(logger) with the same data populated. help is much appreciated

Rohit Sharma
  • 3,304
  • 2
  • 19
  • 34

1 Answers1

1

You can route to that component again and if you have data in variables that would be reflected.

You can use service for storing your data in angular provide that in providers array in app.module.ts .Doing this you will have only one instance of that service in your application and it's value won't change if you go to another route.

So, when you come back to that route it's data will be populated.