@@ -131,10 +131,10 @@ export class MatButton extends _MatButtonMixinBase
131
131
implements OnDestroy , CanDisable , CanColor , CanDisableRipple {
132
132
133
133
/** Whether the button is round. */
134
- _isRoundButton : boolean = this . _hasAttributeWithPrefix ( ' fab', 'mini-fab' ) ;
134
+ _isRoundButton : boolean = this . _hasHostAttributes ( 'mat- fab', 'mat- mini-fab' ) ;
135
135
136
136
/** Whether the button is icon button. */
137
- _isIconButton : boolean = this . _hasAttributeWithPrefix ( ' icon-button') ;
137
+ _isIconButton : boolean = this . _hasHostAttributes ( 'mat- icon-button') ;
138
138
139
139
constructor ( renderer : Renderer2 ,
140
140
elementRef : ElementRef ,
@@ -161,18 +161,16 @@ export class MatButton extends _MatButtonMixinBase
161
161
return this . disableRipple || this . disabled ;
162
162
}
163
163
164
- /** Gets whether the button has one of the given attributes with a 'mat-' prefix . */
165
- _hasAttributeWithPrefix ( ...unprefixedAttributeNames : string [ ] ) {
164
+ /** Gets whether the button has one of the given attributes. */
165
+ _hasHostAttributes ( ...attributes : string [ ] ) {
166
166
// If not on the browser, say that there are none of the attributes present.
167
167
// Since these only affect how the ripple displays (and ripples only happen on the client),
168
168
// detecting these attributes isn't necessary when not on the browser.
169
169
if ( ! this . _platform . isBrowser ) {
170
170
return false ;
171
171
}
172
172
173
- return unprefixedAttributeNames . some ( suffix => {
174
- return this . _getHostElement ( ) . hasAttribute ( 'mat-' + suffix ) ;
175
- } ) ;
173
+ return attributes . some ( attribute => this . _getHostElement ( ) . hasAttribute ( attribute ) ) ;
176
174
}
177
175
}
178
176
0 commit comments