2018-01-26 16:00:07 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {Observable} from 'rxjs/Observable';
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
2018-07-09 14:13:38 +02:00
|
|
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'openaire-linking-generic',
|
2018-07-09 14:13:38 +02:00
|
|
|
template: `<linking-generic [communityId]=communityId></linking-generic>`
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
})
|
|
|
|
export class OpenaireLinkingComponent {
|
2018-07-09 14:13:38 +02:00
|
|
|
communityId:string;
|
|
|
|
constructor (
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private _router: Router
|
2018-01-26 16:00:07 +01:00
|
|
|
|
2018-07-09 14:13:38 +02:00
|
|
|
) {
|
|
|
|
this.route.queryParams.subscribe(
|
|
|
|
communityId => {
|
|
|
|
this.communityId = communityId['communityId'];
|
|
|
|
if(!this.communityId){
|
|
|
|
this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|