From b34713cd52f5c40b11f01aa9e8007700f5ec9404 Mon Sep 17 00:00:00 2001 From: Amit Gharat Date: Sat, 18 May 2019 20:59:23 +0530 Subject: [PATCH 1/2] fix(button): avoid direct access to nativeElement for consistency --- src/material/button/button.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material/button/button.ts b/src/material/button/button.ts index 261e3133f031..f79addb27c9e 100644 --- a/src/material/button/button.ts +++ b/src/material/button/button.ts @@ -98,7 +98,7 @@ export class MatButton extends _MatButtonMixinBase // attributes, add the correct corresponding class. for (const attr of BUTTON_HOST_ATTRIBUTES) { if (this._hasHostAttributes(attr)) { - (elementRef.nativeElement as HTMLElement).classList.add(attr); + this._getHostElement().classList.add(attr); } } From 6edd0d38033a631a0e3c68b5d4042d451403d4ec Mon Sep 17 00:00:00 2001 From: Amit Gharat Date: Tue, 21 May 2019 10:14:40 +0530 Subject: [PATCH 2/2] chore(button): re-use common function for getting native element --- src/material/button/button.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material/button/button.ts b/src/material/button/button.ts index f79addb27c9e..1f2bede9d2da 100644 --- a/src/material/button/button.ts +++ b/src/material/button/button.ts @@ -98,7 +98,7 @@ export class MatButton extends _MatButtonMixinBase // attributes, add the correct corresponding class. for (const attr of BUTTON_HOST_ATTRIBUTES) { if (this._hasHostAttributes(attr)) { - this._getHostElement().classList.add(attr); + (this._getHostElement() as HTMLElement).classList.add(attr); } }