I am trying this but it's not working. I am implementing management software do and I need this solution
RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})
Right now I am on the page in the last position okay once I am clicking and navigating to the second page once I am back on how to be in the last position.