mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-17 15:37:57 +01:00
setComponentParameters from modal
This commit is contained in:
parent
4bf44fa5b8
commit
ff13cb2838
@ -32,7 +32,8 @@ export class ModalComponent implements OnDestroy {
|
||||
document.body.removeChild(document.querySelector('.modal-backdrop'));
|
||||
}
|
||||
|
||||
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.onShow.emit();
|
||||
this.messagingService.send('modalShow');
|
||||
this.parentContainer = parentContainer;
|
||||
@ -45,6 +46,9 @@ export class ModalComponent implements OnDestroy {
|
||||
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory<T>(type);
|
||||
const componentRef = this.container.createComponent<T>(factory);
|
||||
if (setComponentParameters != null) {
|
||||
setComponentParameters(componentRef.instance);
|
||||
}
|
||||
|
||||
document.querySelector('.modal-dialog').addEventListener('click', (e: Event) => {
|
||||
e.stopPropagation();
|
||||
|
Loading…
Reference in New Issue
Block a user