From ff13cb283896c68128fccf28ae65b89c090be522 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 25 Jul 2019 12:22:22 -0400 Subject: [PATCH] setComponentParameters from modal --- src/angular/components/modal.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/angular/components/modal.component.ts b/src/angular/components/modal.component.ts index d939cac1ee..d851710f24 100644 --- a/src/angular/components/modal.component.ts +++ b/src/angular/components/modal.component.ts @@ -32,7 +32,8 @@ export class ModalComponent implements OnDestroy { document.body.removeChild(document.querySelector('.modal-backdrop')); } - show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T { + show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true, + setComponentParameters: (component: T) => void = null): T { this.onShow.emit(); this.messagingService.send('modalShow'); this.parentContainer = parentContainer; @@ -45,6 +46,9 @@ export class ModalComponent implements OnDestroy { const factory = this.componentFactoryResolver.resolveComponentFactory(type); const componentRef = this.container.createComponent(factory); + if (setComponentParameters != null) { + setComponentParameters(componentRef.instance); + } document.querySelector('.modal-dialog').addEventListener('click', (e: Event) => { e.stopPropagation();