Scroll to top with Angular 4 using @HostListener

Add this to your component TypeScript file. import { Component, OnInit, Inject, HostListener } from [email protected]/core'; import { DOCUMENT } from "@angular/platform-browser"; @Component({ selector: [...]