Skip to content
Snippets Groups Projects
Commit 609fff22 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: citation gets destroyed after template switch

parent 89bec6ee
No related branches found
No related tags found
No related merge requests found
import { Directive, Input, TemplateRef, HostListener } from "@angular/core";
import { Directive, Input, TemplateRef, HostListener, OnDestroy } from "@angular/core";
import { ToastService } from "../../services/toastService.service";
@Directive({
selector: '[showToast]'
})
export class ShowToastDirective{
export class ShowToastDirective implements OnDestroy{
@Input()
showToast : string | TemplateRef<any> = null
......@@ -41,4 +41,8 @@ export class ShowToastDirective{
constructor(private toastService:ToastService){
}
ngOnDestroy(){
if(this.dismissHandler) this.dismissHandler()
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment