@@ -131,10 +131,10 @@ export class MatButton extends _MatButtonMixinBase
131131 implements OnDestroy , CanDisable , CanColor , CanDisableRipple {
132132
133133 /** Whether the button is round. */
134- _isRoundButton : boolean = this . _hasAttributeWithPrefix ( ' fab', 'mini-fab' ) ;
134+ _isRoundButton : boolean = this . _hasHostAttributes ( 'mat- fab', 'mat- mini-fab' ) ;
135135
136136 /** Whether the button is icon button. */
137- _isIconButton : boolean = this . _hasAttributeWithPrefix ( ' icon-button') ;
137+ _isIconButton : boolean = this . _hasHostAttributes ( 'mat- icon-button') ;
138138
139139 constructor ( renderer : Renderer2 ,
140140 elementRef : ElementRef ,
@@ -161,18 +161,16 @@ export class MatButton extends _MatButtonMixinBase
161161 return this . disableRipple || this . disabled ;
162162 }
163163
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 [ ] ) {
166166 // If not on the browser, say that there are none of the attributes present.
167167 // Since these only affect how the ripple displays (and ripples only happen on the client),
168168 // detecting these attributes isn't necessary when not on the browser.
169169 if ( ! this . _platform . isBrowser ) {
170170 return false ;
171171 }
172172
173- return unprefixedAttributeNames . some ( suffix => {
174- return this . _getHostElement ( ) . hasAttribute ( 'mat-' + suffix ) ;
175- } ) ;
173+ return attributes . some ( attribute => this . _getHostElement ( ) . hasAttribute ( attribute ) ) ;
176174 }
177175}
178176
0 commit comments