From 263f01204489121a42ac9e5fe55d2e715e0eed2c Mon Sep 17 00:00:00 2001 From: Dmytro Yarmak Date: Fri, 15 Jun 2018 16:17:54 +0300 Subject: [PATCH] fix(module:nz-alert): emit close after fade animation is done Fixes #1666 --- components/alert/nz-alert.component.html | 2 +- components/alert/nz-alert.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/alert/nz-alert.component.html b/components/alert/nz-alert.component.html index 56436b693f6..d2739b18968 100644 --- a/components/alert/nz-alert.component.html +++ b/components/alert/nz-alert.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/components/alert/nz-alert.component.ts b/components/alert/nz-alert.component.ts index d2117f26853..87441479be2 100644 --- a/components/alert/nz-alert.component.ts +++ b/components/alert/nz-alert.component.ts @@ -126,7 +126,12 @@ export class NzAlertComponent implements OnInit { closeAlert(): void { this.display = false; - this.nzOnClose.emit(true); + } + + onFadeAnimationDone(): void { + if (!this.display) { + this.nzOnClose.emit(true); + } } updateOuterClassMap(): void {