mirror of
https://github.com/bitwarden/browser
synced 2024-12-26 18:04:07 +01:00
setComponentParameters for modal
This commit is contained in:
parent
55481b255b
commit
8f886df84f
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit d61794265a12076b765876b52cef597862727b1f
|
Subproject commit ff13cb283896c68128fccf28ae65b89c090be522
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user