Project

General

Profile

1
import {Component, HostListener, OnInit} from '@angular/core';
2
import {Title} from '@angular/platform-browser';
3
import {ActivatedRoute} from '@angular/router';
4
import {properties} from '../../environments/environment';
5

    
6
@Component({
7
  selector: 'sushilite',
8
  templateUrl: 'sushilite.component.html',
9
  styleUrls: ['sushilite.component.css'],
10
})
11
export class SushiliteComponent implements OnInit {
12
  
13
  public url: string;
14
  public reportTitle: string;
15
  public screenHeight: number;
16
  
17
  constructor(private title: Title,
18
              private route: ActivatedRoute) {
19
    this.getScreenSize();
20
  }
21
  
22
  ngOnInit() {
23
    this.route.params.subscribe(params => {
24
      this.reportTitle = params['id'] + ' Report';
25
      this.title.setTitle('OpenAIRE - UsageCounts | ' + this.reportTitle);
26
      this.url = properties.sushiliteURL + params['id'];
27
    });
28
  }
29
  
30
  @HostListener('window:resize', ['$event'])
31
  getScreenSize(event?) {
32
    this.screenHeight = window.innerHeight - 100;
33
  }
34
}
(3-3/4)