Project

General

Profile

1
/**
2
 * Created by stefania on 10/3/16.
3
 */
4
import {Component, OnInit} from "@angular/core";
5
import {NavigationEnd, Router} from "@angular/router";
6

    
7
@Component({
8
  selector: 'openaire-dashboard',
9
  templateUrl: './app.component.html',
10
})
11

    
12
export class AppComponent implements OnInit {
13

    
14
  constructor(private router: Router) {
15
  }
16

    
17
  ngOnInit() {
18
    this.router.events.subscribe((evt) => {
19
      if (!(evt instanceof NavigationEnd)) {
20
        return;
21
      }
22
      window.scrollTo(0, 0);
23
    });
24
  }
25
}
(2-2/7)