From d6522467a249242d2d8f8d792febcbc16860c471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Mon, 14 Dec 2020 11:18:43 +0100 Subject: [PATCH] fix(module:button): only warn about deprecated value when used Only warn about the deprecated nzType="danger" value if that value is actually used rather than any value for nzType. fixes #6191 --- components/button/button.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/button/button.component.ts b/components/button/button.component.ts index a5679e9131d..2793b805de7 100644 --- a/components/button/button.component.ts +++ b/components/button/button.component.ts @@ -135,7 +135,7 @@ export class NzButtonComponent implements OnDestroy, OnChanges, AfterViewInit, A this.loading$.next(this.nzLoading); } - if (nzType) { + if (nzType?.currentValue === 'danger') { warnDeprecation(`'danger' value of 'nzType' in Button is going to be removed in 12.0.0. Please use 'nzDanger' instead.`); } }