1
|
import {Component} from '@angular/core';
|
2
|
import {ActivatedRoute} from '@angular/router';
|
3
|
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
4
|
import {Subscriber} from "rxjs";
|
5
|
|
6
|
|
7
|
|
8
|
@Component({
|
9
|
selector: 'openaire-my-claims',
|
10
|
template: `
|
11
|
<my-claims *ngIf="userInfoURL && claimsInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL">
|
12
|
</my-claims>
|
13
|
`
|
14
|
|
15
|
})
|
16
|
export class OpenaireMyClaimsComponent {
|
17
|
claimsInfoURL:string;
|
18
|
userInfoURL: string;
|
19
|
sub;
|
20
|
constructor (private route: ActivatedRoute) {
|
21
|
}
|
22
|
ngOnDestroy() {
|
23
|
if (this.sub instanceof Subscriber) {
|
24
|
this.sub.unsubscribe();
|
25
|
}
|
26
|
}
|
27
|
public ngOnInit() {
|
28
|
this.sub = this.route.data
|
29
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
30
|
this.claimsInfoURL = data.envSpecific.claimsInformationLink;
|
31
|
this.userInfoURL = data.envSpecific.userInfoUrl;
|
32
|
});
|
33
|
}
|
34
|
}
|