mirror of
https://github.com/bitwarden/web
synced 2025-12-16 16:23:31 +00:00
setComponentParameters for modal
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: d61794265a...ff13cb2838
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user