VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. Scroll to the the top of the page automatically in AngularJS
Programming Blog

Atom/RSS Feed

angular

Scroll to the the top of the page automatically in AngularJS

angular

You can scroll to the top of the page automatically by injecting Window and using the function scroll(x,y).

Window docs

Scroll to top code example

constructor(
        @Inject('Window') window: Window
) {
    window.scroll(0, 0);
}
Join my mailing list