connect/src/app/claims/linking/linkingGeneric.component.ts

26 lines
851 B
TypeScript
Raw Normal View History

import {Component} from '@angular/core';
import {ActivatedRoute} 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) {
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.route.queryParams.subscribe(
communityId => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
});
});
}
}