diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 970c0a6..7cd43ed 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -18,7 +18,7 @@
-

1397

+

{{res2.total}}

research data

diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index eacc2a9..afda36d 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -21,6 +21,7 @@ export class CommunityComponent { public pageTitle = "OpenAIRE" public res=[]; + public res2=[]; constructor ( private route: ActivatedRoute, @@ -54,6 +55,11 @@ export class CommunityComponent { this.res = res; console.log(res); }); + this._communityService.getNumberOfResearchData().subscribe( + res2 => { + this.res2 = res2; + console.log(res2); + }); } public ngOnDestroy() { if(this.piwiksub){ diff --git a/src/app/community/community.service.ts b/src/app/community/community.service.ts index 02413e4..9913647 100644 --- a/src/app/community/community.service.ts +++ b/src/app/community/community.service.ts @@ -6,11 +6,16 @@ import { Observable } from 'rxjs/Rx'; @Injectable() export class CommunityService { -constructor(private http:Http) { + constructor(private http:Http) { + } + + getNumberOfPublications() { + return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/publications/count?format=json') + .map(res => res.json()).do(res => {console.log(res)}); } -getNumberOfPublications() { - return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/publications/count?format=json').map(res => res.json()).do(res => {console.log(res)}); -} - + getNumberOfResearchData() { + return this.http.get('http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/datasets/count?format=json&fq=communityid=egi') + .map(res => res.json()).do(res => {console.log(res)}); + } }