Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

angular scroll to top

scrollToTop(){
	window.scroll(0,0);
}
Comment

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)
    
}
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: firestore increment field 
Typescript :: from sklearn.datasets import fetch_mldata error 
Typescript :: multi line comments latex 
Typescript :: How to redirect to the previous/next page in Angular 
Typescript :: object of strings typescript 
Typescript :: convert htmlcollection to array 
Typescript :: angular remove object from array by id 
Typescript :: length of object in typescript 
Typescript :: if driver element exists python 
Typescript :: download brackets code editor for ubuntu linux 
Typescript :: string to date in typescript 
Typescript :: angular host binding class on input 
Typescript :: ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. 
Typescript :: angular refresh page without reloading 
Typescript :: adonis load many 
Typescript :: how to clear all the dropdown elements in jquery 
Typescript :: google chrome extensions content scripts matches 
Typescript :: typescript show arguments on function call vscode 
Typescript :: kotlin toast.makeText non of the arguments supplied 
Typescript :: typescript create guid 
Typescript :: model has no objects member django 
Typescript :: keyboard shortcuts spotify 
Typescript :: how to extract digits of a number in c 
Typescript :: cannot find module jquery typescript ionic 
Typescript :: What were four effects of the War of 1812? 
Typescript :: a href without redirecting 
Typescript :: angular hide element from component when on certain page 
Typescript :: how to remove duplcates elements from arraylist 
Typescript :: typescript array to string 
Typescript :: check if document exists mongodb python 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =