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
|
import{EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
6
|
|
7
|
@Component({
|
8
|
selector: 'about',
|
9
|
template: `
|
10
|
<div class=" uk-section uk-margin-large-top tm-middle uk-container" id="tm-main">
|
11
|
<div class="uk-container uk-margin-bottom">
|
12
|
<html-page></html-page>
|
13
|
</div>
|
14
|
</div>
|
15
|
`
|
16
|
})
|
17
|
export class AboutPageComponent {
|
18
|
properties:EnvProperties;
|
19
|
|
20
|
constructor ( private route: ActivatedRoute, private _router: Router,
|
21
|
private _meta: Meta, private _title: Title) {}
|
22
|
|
23
|
public ngOnInit() {
|
24
|
this.route.data
|
25
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
26
|
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
27
|
this.updateTitle("About");
|
28
|
this.updateDescription("About, open access");
|
29
|
});
|
30
|
}
|
31
|
|
32
|
private updateDescription(description:string){
|
33
|
this._meta.updateTag({content:description},"name='description'");
|
34
|
this._meta.updateTag({content:description},"property='og:description'");
|
35
|
}
|
36
|
private updateTitle(title:string){
|
37
|
var _prefix ="OpenAIRE | ";
|
38
|
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
39
|
this._title.setTitle(_title);
|
40
|
this._meta.updateTag({content:_title},"property='og:title'");
|
41
|
}
|
42
|
private updateUrl(url:string){
|
43
|
this._meta.updateTag({content:url},"property='og:url'");
|
44
|
}
|
45
|
}
|