29 lines
848 B
TypeScript
29 lines
848 B
TypeScript
|
import {Component, Input} from '@angular/core';
|
||
|
import {Observable} from 'rxjs/Observable';
|
||
|
import {ActivatedRoute, Router} from '@angular/router';
|
||
|
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'openaire-linking-generic',
|
||
|
template: `<linking-generic [communityId]=communityId></linking-generic>`
|
||
|
|
||
|
})
|
||
|
export class OpenaireLinkingComponent {
|
||
|
communityId:string;
|
||
|
constructor (
|
||
|
private route: ActivatedRoute,
|
||
|
private _router: Router
|
||
|
|
||
|
) {
|
||
|
this.route.queryParams.subscribe(
|
||
|
communityId => {
|
||
|
this.communityId = communityId['communityId'];
|
||
|
if(!this.communityId){
|
||
|
this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
}
|