Revision 60872
Added by Konstantinos Triantafyllou almost 3 years ago
team.component.ts | ||
---|---|---|
1 |
import {Component} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component'; |
3 | 3 |
import {member, team} from './team'; |
4 |
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; |
|
5 |
import {Meta, Title} from '@angular/platform-browser'; |
|
6 |
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; |
|
7 |
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
|
8 |
import {properties} from '../../environments/environment'; |
|
9 |
import {Subscription} from 'rxjs'; |
|
10 |
import {Router} from '@angular/router'; |
|
4 | 11 |
|
5 | 12 |
@Component({ |
6 | 13 |
selector: 'team', |
... | ... | |
67 | 74 |
`, |
68 | 75 |
styleUrls: ['team.component.css'] |
69 | 76 |
}) |
70 |
export class TeamComponent { |
|
77 |
export class TeamComponent implements OnInit, OnDestroy {
|
|
71 | 78 |
public team: member[] = team; |
79 |
properties: EnvProperties = properties |
|
80 |
description = "The OpenAIRE Research Graph Team"; |
|
81 |
title = "OpenAIRE - Research Graph | Team"; |
|
82 |
subs: Subscription[] = []; |
|
72 | 83 |
public breadcrumbs: Breadcrumb[] = [ |
73 | 84 |
{ |
74 | 85 |
name: 'home', |
... | ... | |
82 | 93 |
name: 'Team' |
83 | 94 |
} |
84 | 95 |
]; |
96 |
|
|
97 |
constructor(private _title: Title, private _piwikService:PiwikService, |
|
98 |
private _router: Router, private _meta: Meta, |
|
99 |
private seoService: SEOService) { |
|
100 |
} |
|
101 |
|
|
102 |
ngOnInit() { |
|
103 |
this._title.setTitle(this.title); |
|
104 |
this._meta.updateTag({content:this.description},"name='description'"); |
|
105 |
this._meta.updateTag({content:this.description},"property='og:description'"); |
|
106 |
this._meta.updateTag({content:this.title},"property='og:title'"); |
|
107 |
var url = this.properties.domain + this.properties.baseLink+this._router.url; |
|
108 |
this.seoService.createLinkForCanonicalURL(url, false); |
|
109 |
this._meta.updateTag({content:url},"property='og:url'"); |
|
110 |
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ |
|
111 |
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe()); |
|
112 |
} |
|
113 |
} |
|
114 |
|
|
115 |
public ngOnDestroy() { |
|
116 |
this.subs.forEach(sub => { |
|
117 |
if(sub instanceof Subscription) { |
|
118 |
sub.unsubscribe(); |
|
119 |
} |
|
120 |
}); |
|
121 |
} |
|
85 | 122 |
} |
Also available in: Unified diff
[Graph | Trunk]: Add meta data information to new pages