-1๐
- you have to create a shared component / service file where your shared variable which is being used by more than one component will be stored
- Call that component in both of your components where you want to fetch and update data
- It will maintain its state even if data is changed
Source:stackexchange.com