I have a list-component where I want to keep the pageIndex value by setting some variables in another class just before navigating to another component let's say x-component. Then, when navigating back to the list-component, I want to get the previously set pageIndex so that open that page instead of opening the first page on the datatable. So, what is an alegant way to fix this problem without using a service or subcribtion? I can use another class, but not a service. I tried to retrieve the set values from a class, but pageIndex value is undefined when trying to retrieve it.
Any help would be appreciated.