Skip to content

Commit c02b7c2

Browse files
vishalshrm539Sharma
andauthored
Fixed blank screen issue in embedded (#338)
* Fixed blank screen issue in embedded --------- Co-authored-by: Sharma <[email protected]>
1 parent bbfd3f2 commit c02b7c2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

projects/angular-test-app/src/app/_samples/embedded/embedded.component.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, OnDestroy } from '@angular/core';
1+
import { Component, OnInit, OnDestroy, NgZone } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { MatButtonModule } from '@angular/material/button';
44
import { MatIconModule } from '@angular/material/icon';
@@ -41,7 +41,10 @@ export class EmbeddedComponent implements OnInit, OnDestroy {
4141

4242
bootstrapShell: any;
4343

44-
constructor(private psservice: ProgressSpinnerService) {}
44+
constructor(
45+
private psservice: ProgressSpinnerService,
46+
private ngZone: NgZone
47+
) {}
4548

4649
ngOnInit() {
4750
this.initialize();
@@ -103,11 +106,11 @@ export class EmbeddedComponent implements OnInit, OnDestroy {
103106
// Change to reflect new use of arg in the callback:
104107
const { props } = renderObj;
105108

106-
this.pConn$ = props.getPConnect();
107-
108-
this.bHasPConnect$ = true;
109-
110-
this.showHideProgress(false);
109+
this.ngZone.run(() => {
110+
this.pConn$ = props.getPConnect();
111+
this.bHasPConnect$ = true;
112+
this.showHideProgress(false);
113+
});
111114
}
112115

113116
showHideProgress(bShow: boolean) {

0 commit comments

Comments
 (0)