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
Asked
Active
Viewed 1,670 times
1
-
2Possible duplicate of [How to go back last page](https://stackoverflow.com/questions/35446955/how-to-go-back-last-page) – Amit Chigadani Aug 31 '18 at 08:44
-
What kind of data do you need to restore? – user184994 Aug 31 '18 at 08:49
1 Answers
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.

Swapnil Sanu
- 76
- 4