@@ -46,14 +46,14 @@ let nextUniqueId = 0;
4646 * complex placeholders.
4747 */
4848@Directive ( {
49- selector : 'md-placeholder'
49+ selector : 'md-placeholder, mat-placeholder '
5050} )
5151export class MdPlaceholder { }
5252
5353
5454/** The hint directive, used to tag content as hint labels (going under the input). */
5555@Directive ( {
56- selector : 'md-hint' ,
56+ selector : 'md-hint, mat-hint ' ,
5757 host : {
5858 'class' : 'md-hint' ,
5959 '[class.md-right]' : 'align == "end"' ,
@@ -67,7 +67,7 @@ export class MdHint {
6767
6868/** The input directive, used to mark the input that `MdInputContainer` is wrapping. */
6969@Directive ( {
70- selector : 'input[md-input], textarea[md-input]' ,
70+ selector : 'input[md-input], textarea[md-input], input[mat-input], textarea[mat-input] ' ,
7171 host : {
7272 'class' : 'md-input-element' ,
7373 '[id]' : 'id' ,
@@ -153,6 +153,12 @@ export class MdInputDirective implements AfterContentInit {
153153 /** Focus the input element. */
154154 focus ( ) { this . _renderer . invokeElementMethod ( this . _elementRef . nativeElement , 'focus' ) ; }
155155
156+ _onFocus ( ) { this . focused = true ; }
157+
158+ _onBlur ( ) { this . focused = false ; }
159+
160+ _onInput ( ) { this . value = this . _elementRef . nativeElement . value ; }
161+
156162 /** Make sure the input is a supported type. */
157163 private _validateType ( ) {
158164 if ( MD_INPUT_INVALID_TYPES . indexOf ( this . _type ) != - 1 ) {
@@ -161,12 +167,6 @@ export class MdInputDirective implements AfterContentInit {
161167 }
162168
163169 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 ; }
170170}
171171
172172
@@ -176,7 +176,7 @@ export class MdInputDirective implements AfterContentInit {
176176 */
177177@Component ( {
178178 moduleId : module . id ,
179- selector : 'md-input-container' ,
179+ selector : 'md-input-container, mat-input-container ' ,
180180 templateUrl : 'input-container.html' ,
181181 styleUrls : [ 'input.css' , 'input-container.css' ] ,
182182 host : {
@@ -228,6 +228,8 @@ export class MdInputContainer implements AfterContentInit {
228228 return ! ! this . _mdInputChild . placeholder || ! ! this . _placeholderChild ;
229229 }
230230
231+ _focusInput ( ) { this . _mdInputChild . focus ( ) ; }
232+
231233 /**
232234 * Ensure that there is only one placeholder (either `input` attribute or child element with the
233235 * `md-placeholder` attribute.
@@ -261,6 +263,4 @@ export class MdInputContainer implements AfterContentInit {
261263 } ) ;
262264 }
263265 }
264-
265- private _focusInput ( ) { this . _mdInputChild . focus ( ) ; }
266266}
0 commit comments