81 lines
2.4 KiB
TypeScript
81 lines
2.4 KiB
TypeScript
import {Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
|
|
import {Observable} from 'rxjs/Observable';
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
import {Location} from '@angular/common';
|
|
import "rxjs/add/observable/zip";
|
|
import { Meta, MetaDefinition, ConfigurationService} from 'ng-openaire-library';
|
|
|
|
import { ErrorCodes, RouterHelper, PiwikService} from 'ng-openaire-library';
|
|
import {Properties} from '../utils/properties';
|
|
import {CommunityService} from "./community.service";
|
|
|
|
|
|
@Component({
|
|
selector: 'community',
|
|
templateUrl: 'community.component.html',
|
|
})
|
|
export class CommunityComponent {
|
|
public piwiksub: any;
|
|
public subfunders: any;
|
|
|
|
public pageTitle = "OpenAIRE"
|
|
|
|
public res=[];
|
|
public res2=[];
|
|
public res3=[];
|
|
|
|
constructor (
|
|
private route: ActivatedRoute,
|
|
private _router: Router,
|
|
private location: Location, private _meta: Meta,private _piwikService:PiwikService,
|
|
private config: ConfigurationService,
|
|
private _communityService:CommunityService
|
|
) {
|
|
|
|
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
|
|
|
|
var title = "OpenAIRE";
|
|
|
|
var url = Properties.getBaseLink()+this._router.url;
|
|
this._meta.setTitle(title);
|
|
this._meta.updateMeta("description", description);
|
|
this._meta.updateProperty("og:description", description);
|
|
this._meta.updateProperty("og:title", title);
|
|
this._meta.updateProperty("og:url", url);
|
|
|
|
|
|
if(Properties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
|
this.piwiksub = this._piwikService.trackView("OpenAIRE").subscribe();
|
|
}
|
|
|
|
}
|
|
|
|
public ngOnInit() {
|
|
this._communityService.getNumberOfPublications().subscribe(
|
|
res => {
|
|
this.res = res;
|
|
console.log(res);
|
|
});
|
|
|
|
this._communityService.getNumberOfResearchData().subscribe(
|
|
res2 => {
|
|
this.res2 = res2;
|
|
console.log(res2);
|
|
});
|
|
|
|
this._communityService.getNumberOfSoftware().subscribe(
|
|
res3 => {
|
|
this.res3 = res3;
|
|
console.log(res3);
|
|
});
|
|
}
|
|
public ngOnDestroy() {
|
|
if(this.piwiksub){
|
|
this.piwiksub.unsubscribe();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|