0

Here is the question, I have a click button.this click event will upadate angular view,Then I want to let the view will show on the top but not using ScrollToTop, So what method can i use?

Having soultions for mine problem

yang
  • 1
  • You can use [ViewPortScroller](https://angular.io/api/common/ViewportScroller) – Navitas28 Jun 01 '23 at 09:44
  • I use it . but it scoll smoothly, is there have any way to scroll immediately? – yang Jun 01 '23 at 10:22
  • Try `window` as parameter, `this.viewportScroller.scrollToTop(window);` – Navitas28 Jun 01 '23 at 10:41
  • I find the solution at https://stackoverflow.com/questions/69585152/angular-scrollpositionrestoration-without-animation-smooth-scrolling, but also thanks for your answer! – yang Jun 02 '23 at 01:37

0 Answers0