Angular 2 Retain data on page reload

questionsAngular 2 Retain data on page reload
jyoti asked 2 years ago

Hi
inĀ Angular 2 how can we retain data on page reload? for example:
In my Angular 2 app, I pass in some data to a PageComponent from my HomeComponent which is then saved to a variable inside the PageComponent. Now when I refresh the page I need this data to be retained. Currently I am using session storage, but I was wondering if there is a better way to implement this.