1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-27 10:23:48 +01:00

setComponentParameters for modal

This commit is contained in:
Kyle Spearrin 2019-07-25 12:24:32 -04:00
parent 55481b255b
commit 8f886df84f
2 changed files with 6 additions and 2 deletions

2
jslib

@ -1 +1 @@
Subproject commit d61794265a12076b765876b52cef597862727b1f Subproject commit ff13cb283896c68128fccf28ae65b89c090be522

View File

@ -25,12 +25,16 @@ export class ModalComponent extends BaseModalComponent {
ngOnDestroy() { /* Nothing */ } ngOnDestroy() { /* Nothing */ }
show<T>(type: Type<T>, parentContainer: ViewContainerRef, fade: boolean = true): T { show<T>(type: Type<T>, parentContainer: ViewContainerRef, fade: boolean = true,
setComponentParameters: (component: T) => void = null): T {
this.parentContainer = parentContainer; this.parentContainer = parentContainer;
this.fade = fade; this.fade = fade;
const factory = this.componentFactoryResolver.resolveComponentFactory<T>(type); const factory = this.componentFactoryResolver.resolveComponentFactory<T>(type);
const componentRef = this.container.createComponent<T>(factory); const componentRef = this.container.createComponent<T>(factory);
if (setComponentParameters != null) {
setComponentParameters(componentRef.instance);
}
const modals = Array.from(document.querySelectorAll('.modal')); const modals = Array.from(document.querySelectorAll('.modal'));
if (modals.length > 0) { if (modals.length > 0) {