1
|
import {Component, Input} from '@angular/core';
|
2
|
import {Observable} from 'rxjs/Observable';
|
3
|
import {ActivatedRoute, Router} from '@angular/router';
|
4
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'openaire-linking-generic',
|
8
|
template: `<linking-generic [communityId]=communityId></linking-generic>`
|
9
|
|
10
|
})
|
11
|
export class OpenaireLinkingComponent {
|
12
|
communityId:string;
|
13
|
constructor (
|
14
|
private route: ActivatedRoute,
|
15
|
private _router: Router
|
16
|
|
17
|
) {
|
18
|
this.route.queryParams.subscribe(
|
19
|
communityId => {
|
20
|
this.communityId = communityId['communityId'];
|
21
|
if(!this.communityId){
|
22
|
this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
23
|
}
|
24
|
|
25
|
});
|
26
|
|
27
|
}
|
28
|
}
|