mirror of
https://github.com/bitwarden/browser
synced 2024-12-25 17:32:46 +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 */ }
|
||||
|
||||
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.fade = fade;
|
||||
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory<T>(type);
|
||||
const componentRef = this.container.createComponent<T>(factory);
|
||||
if (setComponentParameters != null) {
|
||||
setComponentParameters(componentRef.instance);
|
||||
}
|
||||
|
||||
const modals = Array.from(document.querySelectorAll('.modal'));
|
||||
if (modals.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user