1
|
import {Component, Input, Output, EventEmitter, ViewChild, ElementRef} from '@angular/core';
|
2
|
import {Observable} from 'rxjs/Observable';
|
3
|
import {ActivatedRoute, Router} from '@angular/router';
|
4
|
import {Title, Meta} from '@angular/platform-browser';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'content',
|
8
|
templateUrl: './contentPage.component.html'
|
9
|
})
|
10
|
export class ContentPageComponent {
|
11
|
|
12
|
constructor ( private route: ActivatedRoute, private _router: Router,
|
13
|
private _meta: Meta, private _title: Title) {}
|
14
|
|
15
|
public ngOnInit() {
|
16
|
this.updateTitle("Content");
|
17
|
this.updateDescription("content, open access");
|
18
|
|
19
|
}
|
20
|
|
21
|
private updateDescription(description:string){
|
22
|
this._meta.updateTag({content:description},"name='description'");
|
23
|
this._meta.updateTag({content:description},"property='og:description'");
|
24
|
}
|
25
|
private updateTitle(title:string){
|
26
|
var _prefix ="OpenAIRE | ";
|
27
|
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
28
|
this._title.setTitle(_title);
|
29
|
this._meta.updateTag({content:_title},"property='og:title'");
|
30
|
}
|
31
|
private updateUrl(url:string){
|
32
|
this._meta.updateTag({content:url},"property='og:url'");
|
33
|
}
|
34
|
}
|