From 8f886df84f3f354667037589600fc06ec3261a45 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 25 Jul 2019 12:24:32 -0400 Subject: [PATCH] setComponentParameters for modal --- jslib | 2 +- src/app/modal.component.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jslib b/jslib index d61794265a1..ff13cb28389 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d61794265a12076b765876b52cef597862727b1f +Subproject commit ff13cb283896c68128fccf28ae65b89c090be522 diff --git a/src/app/modal.component.ts b/src/app/modal.component.ts index 478f22792ab..5f1b7ca2e90 100644 --- a/src/app/modal.component.ts +++ b/src/app/modal.component.ts @@ -25,12 +25,16 @@ export class ModalComponent extends BaseModalComponent { ngOnDestroy() { /* Nothing */ } - show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T { + show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true, + setComponentParameters: (component: T) => void = null): T { this.parentContainer = parentContainer; this.fade = fade; const factory = this.componentFactoryResolver.resolveComponentFactory(type); const componentRef = this.container.createComponent(factory); + if (setComponentParameters != null) { + setComponentParameters(componentRef.instance); + } const modals = Array.from(document.querySelectorAll('.modal')); if (modals.length > 0) {