Answers for "angular window scroll to top not working"

3

angular scroll to top

scrollToTop(){
	window.scroll(0,0);
}
Posted by: Guest on January-12-2021
3

scroll to top angular

//inside the app.component.html add (activate):
<router-outlet  (activate)="onActivate($event)"></router-outlet>

//inside app.component.ts, add inside the class of the component:
export class AppComponent {
 
  onActivate(event) {
    window.scroll(0,0);
    //or document.body.scrollTop = 0;
    //or document.querySelector('body').scrollTo(0,0)
    
}
}
Posted by: Guest on October-28-2020
0

angular window scroll to top not working

var callback = getByClass(containers[i],
Posted by: Guest on July-31-2021

Code answers related to "angular window scroll to top not working"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language