Angular 6 - Keep scroll position when the route changes

后端 未结 4 2063
萌比男神i
萌比男神i 2021-01-04 12:52

Previous Behavior:

Changing the route or navigation path would not affect the scroll position when navigating to another route. I.e the contents can

4条回答
  •  悲哀的现实
    2021-01-04 13:06

    if scroll restoration doesnt work , Create a service that updates the current scroll Position on the change of that route and assign the scroll position to that service scroll position on ngOnit for the new route component and reset the service scroll.

提交回复
热议问题