diff --git a/packages/mosaic-dev/modal/module.ts b/packages/mosaic-dev/modal/module.ts index 8fab361d6..ea435395d 100644 --- a/packages/mosaic-dev/modal/module.ts +++ b/packages/mosaic-dev/modal/module.ts @@ -105,6 +105,7 @@ export class ModalDemoComponent { window.setTimeout(() => { const instance = modal.getContentComponent(); instance.subtitle = 'sub title is changed'; + modal.markForCheck(); }, 2000); } diff --git a/packages/mosaic/modal/modal-ref.class.ts b/packages/mosaic/modal/modal-ref.class.ts index f84571163..87dfc4958 100644 --- a/packages/mosaic/modal/modal-ref.class.ts +++ b/packages/mosaic/modal/modal-ref.class.ts @@ -48,4 +48,9 @@ export abstract class McModalRef { * Get the instance of the Modal itself */ abstract getInstance(): McModalComponent; + + /** + * Call markForCheck for change detector + */ + abstract markForCheck(); } diff --git a/packages/mosaic/modal/modal.component.ts b/packages/mosaic/modal/modal.component.ts index 893838072..9995c4f49 100644 --- a/packages/mosaic/modal/modal.component.ts +++ b/packages/mosaic/modal/modal.component.ts @@ -166,7 +166,8 @@ export class McModalComponent extends McModalRef private viewContainer: ViewContainerRef, private modalControl: McModalControlService, private changeDetector: ChangeDetectorRef, - @Inject(DOCUMENT) private document: any) { + @Inject(DOCUMENT) private document: any + ) { super(); } @@ -249,6 +250,10 @@ export class McModalComponent extends McModalRef this.close(result); } + markForCheck() { + this.changeDetector.markForCheck(); + } + triggerOk() { this.onClickOkCancel('ok'); }