DEV Community

Faisal Ahmed
Faisal Ahmed

Posted on

in product details page, go to the top position on the details page

_base.scss

html {
  scroll-behavior: smooth;
}
Enter fullscreen mode Exit fullscreen mode

Image description

app-routing.module.ts

@NgModule({
  imports: [RouterModule.forRoot(routes, {
    scrollPositionRestoration: 'enabled',
    anchorScrolling: 'enabled',
    preloadingStrategy: CustomPreloadingStrategy
  })],
  exports: [RouterModule],
  providers: [UserAuthGuard, UserAuthStateGuard]
})
export class AppRoutingModule {
}
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)