Amin-Naimi / Some_Angular_Issues

Repository from Github https://github.comAmin-Naimi/Some_Angular_IssuesRepository from Github https://github.comAmin-Naimi/Some_Angular_Issues

Some_Angular_Issues:

Routing:

  1. Scroll to top on navigation in Angular:

    In Angular applications using the default routing settings, the scroll position remains unchanged when moving between pages. This means that if you scroll down on one page and click a link to navigate, the next page will open with the scroll position retained.
    To solve that, you can use the "scrollPositionRestoration" option and set it to "enabled".

     @NgModule({
     imports: [
     RouterModule.forRoot(routes, { scrollPositionRestoration: "enabled" }),
     ],
     exports: [RouterModule],
     })
     export class AppRoutingModule {}
    

About