@@ -46,14 +46,14 @@ let nextUniqueId = 0;
46
46
* complex placeholders.
47
47
*/
48
48
@Directive ( {
49
- selector : 'md-placeholder'
49
+ selector : 'md-placeholder, mat-placeholder '
50
50
} )
51
51
export class MdPlaceholder { }
52
52
53
53
54
54
/** The hint directive, used to tag content as hint labels (going under the input). */
55
55
@Directive ( {
56
- selector : 'md-hint' ,
56
+ selector : 'md-hint, mat-hint ' ,
57
57
host : {
58
58
'class' : 'md-hint' ,
59
59
'[class.md-right]' : 'align == "end"' ,
@@ -67,7 +67,7 @@ export class MdHint {
67
67
68
68
/** The input directive, used to mark the input that `MdInputContainer` is wrapping. */
69
69
@Directive ( {
70
- selector : 'input[md-input], textarea[md-input]' ,
70
+ selector : 'input[md-input], textarea[md-input], input[mat-input], textarea[mat-input] ' ,
71
71
host : {
72
72
'class' : 'md-input-element' ,
73
73
'[id]' : 'id' ,
@@ -153,6 +153,12 @@ export class MdInputDirective implements AfterContentInit {
153
153
/** Focus the input element. */
154
154
focus ( ) { this . _renderer . invokeElementMethod ( this . _elementRef . nativeElement , 'focus' ) ; }
155
155
156
+ _onFocus ( ) { this . focused = true ; }
157
+
158
+ _onBlur ( ) { this . focused = false ; }
159
+
160
+ _onInput ( ) { this . value = this . _elementRef . nativeElement . value ; }
161
+
156
162
/** Make sure the input is a supported type. */
157
163
private _validateType ( ) {
158
164
if ( MD_INPUT_INVALID_TYPES . indexOf ( this . _type ) != - 1 ) {
@@ -161,12 +167,6 @@ export class MdInputDirective implements AfterContentInit {
161
167
}
162
168
163
169
private _isNeverEmpty ( ) { return this . _neverEmptyInputTypes . indexOf ( this . _type ) != - 1 ; }
164
-
165
- private _onFocus ( ) { this . focused = true ; }
166
-
167
- private _onBlur ( ) { this . focused = false ; }
168
-
169
- private _onInput ( ) { this . value = this . _elementRef . nativeElement . value ; }
170
170
}
171
171
172
172
@@ -176,7 +176,7 @@ export class MdInputDirective implements AfterContentInit {
176
176
*/
177
177
@Component ( {
178
178
moduleId : module . id ,
179
- selector : 'md-input-container' ,
179
+ selector : 'md-input-container, mat-input-container ' ,
180
180
templateUrl : 'input-container.html' ,
181
181
styleUrls : [ 'input.css' , 'input-container.css' ] ,
182
182
host : {
@@ -228,6 +228,8 @@ export class MdInputContainer implements AfterContentInit {
228
228
return ! ! this . _mdInputChild . placeholder || ! ! this . _placeholderChild ;
229
229
}
230
230
231
+ _focusInput ( ) { this . _mdInputChild . focus ( ) ; }
232
+
231
233
/**
232
234
* Ensure that there is only one placeholder (either `input` attribute or child element with the
233
235
* `md-placeholder` attribute.
@@ -261,6 +263,4 @@ export class MdInputContainer implements AfterContentInit {
261
263
} ) ;
262
264
}
263
265
}
264
-
265
- private _focusInput ( ) { this . _mdInputChild . focus ( ) ; }
266
266
}
0 commit comments