@@ -11,6 +11,7 @@ import {
11
11
} from '@angular/core' ;
12
12
import { coerceBooleanProperty , FocusOriginMonitor } from '../core' ;
13
13
import { mixinDisabled , CanDisable } from '../core/common-behaviors/disabled' ;
14
+ import { isBrowser } from '../core/platform/browser' ;
14
15
15
16
16
17
// TODO(kara): Convert attribute selectors to classes when attr maps become available
@@ -22,9 +23,7 @@ import {mixinDisabled, CanDisable} from '../core/common-behaviors/disabled';
22
23
*/
23
24
@Directive ( {
24
25
selector : 'button[md-button], button[mat-button], a[md-button], a[mat-button]' ,
25
- host : {
26
- '[class.mat-button]' : 'true'
27
- }
26
+ host : { 'class' : 'mat-button' }
28
27
} )
29
28
export class MdButtonCssMatStyler { }
30
29
@@ -36,9 +35,7 @@ export class MdButtonCssMatStyler {}
36
35
selector :
37
36
'button[md-raised-button], button[mat-raised-button], ' +
38
37
'a[md-raised-button], a[mat-raised-button]' ,
39
- host : {
40
- '[class.mat-raised-button]' : 'true'
41
- }
38
+ host : { 'class' : 'mat-raised-button' }
42
39
} )
43
40
export class MdRaisedButtonCssMatStyler { }
44
41
@@ -49,9 +46,7 @@ export class MdRaisedButtonCssMatStyler {}
49
46
@Directive ( {
50
47
selector :
51
48
'button[md-icon-button], button[mat-icon-button], a[md-icon-button], a[mat-icon-button]' ,
52
- host : {
53
- '[class.mat-icon-button]' : 'true' ,
54
- }
49
+ host : { 'class' : 'mat-icon-button' }
55
50
} )
56
51
export class MdIconButtonCssMatStyler { }
57
52
@@ -61,9 +56,7 @@ export class MdIconButtonCssMatStyler {}
61
56
*/
62
57
@Directive ( {
63
58
selector : 'button[md-fab], button[mat-fab], a[md-fab], a[mat-fab]' ,
64
- host : {
65
- '[class.mat-fab]' : 'true'
66
- }
59
+ host : { 'class' : 'mat-fab' }
67
60
} )
68
61
export class MdFabCssMatStyler { }
69
62
@@ -73,9 +66,7 @@ export class MdFabCssMatStyler {}
73
66
*/
74
67
@Directive ( {
75
68
selector : 'button[md-mini-fab], button[mat-mini-fab], a[md-mini-fab], a[mat-mini-fab]' ,
76
- host : {
77
- '[class.mat-mini-fab]' : 'true'
78
- }
69
+ host : { 'class' : 'mat-mini-fab' }
79
70
} )
80
71
export class MdMiniFabCssMatStyler { }
81
72
@@ -165,6 +156,13 @@ export class MdButton extends _MdButtonMixinBase implements OnDestroy, CanDisabl
165
156
* with either an 'md-' or 'mat-' prefix.
166
157
*/
167
158
_hasAttributeWithPrefix ( ...unprefixedAttributeNames : string [ ] ) {
159
+ // If not on the browser, say that there are none of the attributes present.
160
+ // Since these only affect how the ripple displays (and ripples only happen on the client),
161
+ // detecting these attributes isn't necessary when not on the browser.
162
+ if ( ! isBrowser ( ) ) {
163
+ return false ;
164
+ }
165
+
168
166
return unprefixedAttributeNames . some ( suffix => {
169
167
const el = this . _getHostElement ( ) ;
170
168
0 commit comments