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: `` }) 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); } }); } }