1 import { Component, AfterViewChecked } from '@angular/core'
2 import { ViewportScroller } from '@angular/common'
5 selector: 'my-about-peertube',
6 templateUrl: './about-peertube.component.html',
7 styleUrls: [ './about-peertube.component.scss' ]
10 export class AboutPeertubeComponent implements AfterViewChecked {
11 private lastScrollHash: string
14 private viewportScroller: ViewportScroller
17 ngAfterViewChecked () {
18 if (window.location.hash && window.location.hash !== this.lastScrollHash) {
19 this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', ''))
21 this.lastScrollHash = window.location.hash