import { Component, OnInit, AfterViewInit } from '@angular/core'; @Component({ selector: 'app-blog-details', templateUrl: './blog-details.component.html', styleUrls: ['./blog-details.component.sass'] }) export class BlogDetailsComponent implements AfterViewInit { constructor() { } ngOnInit() { } ngAfterViewInit() { // Hack: Scrolls to top of Page after page view initialized let top = document.getElementById('top'); if (top !== null) { top.scrollIntoView(); top = null; } } }