From c63ff4485eb8a0ff5b4e5c8ef3c851f4ca056646 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 2 Apr 2019 09:02:08 -0400 Subject: [PATCH] modal messages --- src/angular/components/modal.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/angular/components/modal.component.ts b/src/angular/components/modal.component.ts index d63c78af7f7..d939cac1eef 100644 --- a/src/angular/components/modal.component.ts +++ b/src/angular/components/modal.component.ts @@ -9,6 +9,8 @@ import { ViewContainerRef, } from '@angular/core'; +import { MessagingService } from '../../abstractions/messaging.service'; + @Component({ selector: 'app-modal', template: ``, @@ -22,7 +24,8 @@ export class ModalComponent implements OnDestroy { parentContainer: ViewContainerRef = null; fade: boolean = true; - constructor(protected componentFactoryResolver: ComponentFactoryResolver) { } + constructor(protected componentFactoryResolver: ComponentFactoryResolver, + protected messagingService: MessagingService) { } ngOnDestroy() { document.body.classList.remove('modal-open'); @@ -31,6 +34,7 @@ export class ModalComponent implements OnDestroy { show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T { this.onShow.emit(); + this.messagingService.send('modalShow'); this.parentContainer = parentContainer; this.fade = fade; @@ -54,12 +58,15 @@ export class ModalComponent implements OnDestroy { } this.onShown.emit(); + this.messagingService.send('modalShown'); return componentRef.instance; } close() { this.onClose.emit(); + this.messagingService.send('modalClose'); this.onClosed.emit(); + this.messagingService.send('modalClosed'); if (this.parentContainer != null) { this.parentContainer.clear(); }