From: Galen Charlton Date: Wed, 1 Apr 2020 18:35:27 +0000 (-0400) Subject: ensure that provider contact addresses component gets found before reloading its... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=443c9891e318a4b29f22f75f198919f23c9a16f9;p=working%2FEvergreen.git ensure that provider contact addresses component gets found before reloading its grid Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts index 83bcd6c334..d2fd645b3b 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-contacts.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, AfterViewInit, Input, ViewChild} from '@angular/core'; +import {Component, OnInit, AfterViewInit, Input, ViewChild, ChangeDetectorRef} from '@angular/core'; import {empty, throwError, Observable, from} from 'rxjs'; import {map} from 'rxjs/operators'; import {Router, ActivatedRoute, ParamMap} from '@angular/router'; @@ -27,7 +27,7 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { gridSource: GridDataSource; @ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent; - @ViewChild('providerContactAddresses', { static: true }) providerContactAddresses: ProviderContactAddressesComponent; + @ViewChild('providerContactAddresses', { static: false }) providerContactAddresses: ProviderContactAddressesComponent; @ViewChild('acqProviderContactsGrid', { static: true }) providerContactsGrid: GridComponent; @ViewChild('successString', { static: true }) successString: StringComponent; @ViewChild('createString', { static: false }) createString: StringComponent; @@ -52,6 +52,7 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { constructor( private router: Router, private route: ActivatedRoute, + private changeDetector: ChangeDetectorRef, private net: NetService, private auth: AuthService, private idl: IdlService, @@ -94,6 +95,8 @@ export class ProviderContactsComponent implements OnInit, AfterViewInit { (idlThing: IdlObject) => { this.selectedContact = idlThing; console.debug('selected contact',this.selectedContact); + // ensure that the contact address grid is instantiated + this.changeDetector.detectChanges(); this.providerContactAddresses.reloadGrid(); } );