Skip to content

Commit 318d699

Browse files
DavidSoutherjelbourn
authored andcommitted
feat(button): add isIconButton and isRoundButton properties (#11226)
1 parent c936bc9 commit 318d699

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/button/button.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<span class="mat-button-wrapper"><ng-content></ng-content></span>
22
<div matRipple class="mat-button-ripple"
3-
[class.mat-button-ripple-round]="_isRoundButton || _isIconButton"
3+
[class.mat-button-ripple-round]="isRoundButton || isIconButton"
44
[matRippleDisabled]="_isRippleDisabled()"
5-
[matRippleCentered]="_isIconButton"
5+
[matRippleCentered]="isIconButton"
66
[matRippleTrigger]="_getHostElement()"></div>
77
<div class="mat-button-focus-overlay"></div>

src/lib/button/button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ export class MatButton extends _MatButtonMixinBase
7676
implements OnDestroy, CanDisable, CanColor, CanDisableRipple {
7777

7878
/** Whether the button is round. */
79-
_isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');
79+
readonly isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');
8080

8181
/** Whether the button is icon button. */
82-
_isIconButton: boolean = this._hasHostAttributes('mat-icon-button');
82+
readonly isIconButton: boolean = this._hasHostAttributes('mat-icon-button');
8383

8484
/** Reference to the MatRipple instance of the button. */
8585
@ViewChild(MatRipple) ripple: MatRipple;
@@ -104,7 +104,7 @@ export class MatButton extends _MatButtonMixinBase
104104

105105
this._focusMonitor.monitor(this._elementRef.nativeElement, true);
106106

107-
if (this._isRoundButton) {
107+
if (this.isRoundButton) {
108108
this.color = DEFAULT_ROUND_BUTTON_COLOR;
109109
} else if (this._hasHostAttributes('mat-flat-button')) {
110110
this.color = DEFAULT_FLAT_BUTTON_COLOR;

0 commit comments

Comments
 (0)