General: Fix error while initilizing form when stakeholder is changed.

This commit is contained in:
Konstantinos Triantafyllou 2023-03-23 10:45:16 +02:00
parent 0440a5fbfa
commit 9f9127ca91
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import {Component, OnDestroy, OnInit, ViewChild} from "@angular/core";
import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from "@angular/core";
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder";
@ -22,6 +22,7 @@ export class GeneralComponent implements OnInit, OnDestroy {
@ViewChild('editStakeholderComponent') editStakeholderComponent: EditStakeholderComponent;
constructor(private stakeholderService: StakeholderService,
private cdr: ChangeDetectorRef,
private title: Title) {
}
@ -29,6 +30,7 @@ export class GeneralComponent implements OnInit, OnDestroy {
this.loading = true;
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
this.stakeholder = stakeholder;
this.cdr.detectChanges();
if(this.stakeholder) {
this.title.setTitle(this.stakeholder.name + " | General");
let data = zip(