Angular - load new page at top

Viewed 37

What's up. After navigating from page x to page y in my angular application it loads at the bottom. The link on page page x isn't at the top either, so probably (very likely actually) that's why. I want page y to load at the top. I tried using

RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})

but all it does is loading page y at the bottom too and then scroll up. All other solutions I found do the same. Like I said, I just want the page to directly load at the top without any scrolling. I feel like there's simple solution that I just keep overlooking because.. this doesn't sound like it should be a problem lol. Hope someone can help out, thanks in advance.

0 Answers
Related