scrollPositionRestoration : 'top' is not working for RouterModule.forchild()? Is there any solution in angular 7 to make sure that page always scroll top after navigation?
Asked
Active
Viewed 3,622 times
9
-
I have same problem, did you finds any solution for this? – amit gupta May 02 '19 at 09:01
-
Any updates on this? – iBlehhz Jul 19 '19 at 04:41
-
https://stackoverflow.com/questions/48048299/angular-5-scroll-to-top-on-every-route-click?rq=1 I tried this and worked for me. – Santhosh SD Villivakam Aug 02 '19 at 08:36
1 Answers
-3
You can try this:
RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled' }),

Srikar Phani Kumar M
- 1,069
- 1
- 3
- 8
-
The question aims for `RouterModule.forChild()` where `scrollPositionRestoration` is not applicable. – twobiers Apr 19 '22 at 07:25
-
@StarneyBinson please read what his latest comment was on the original post and what worked. my answer is correct. – Srikar Phani Kumar M Apr 21 '22 at 13:11