1
|
import {Component} from '@angular/core';
|
2
|
import {ActivatedRoute, Router} from "@angular/router";
|
3
|
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
4
|
|
5
|
@Component({
|
6
|
selector: 'monitor-search-organizations',
|
7
|
template: `
|
8
|
<div id="page_content">
|
9
|
<search-organizations *ngIf="initialized">
|
10
|
</search-organizations>
|
11
|
</div>
|
12
|
`
|
13
|
})
|
14
|
export class MonitorSearchOrganizationsComponent {
|
15
|
initialized: boolean = false;
|
16
|
|
17
|
constructor(private route: ActivatedRoute,
|
18
|
private router: Router,
|
19
|
private stakeholderService: StakeholderService) {
|
20
|
}
|
21
|
|
22
|
ngOnInit() {
|
23
|
this.route.params.subscribe(params => {
|
24
|
if (params['stakeholder']) {
|
25
|
this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
26
|
if (stakeholder) {
|
27
|
this.initialized = true;
|
28
|
}
|
29
|
});
|
30
|
}
|
31
|
});
|
32
|
}
|
33
|
}
|