@@ -46,8 +46,6 @@ describe('MdInputWrapper', function () {
46
46
47
47
it ( 'should not be treated as empty if type is date' , ( ) => {
48
48
let fixture = TestBed . createComponent ( MdInputWrapperDateTestController ) ;
49
- let inputEl = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
50
- inputEl . placeholder = 'Placeholder' ;
51
49
fixture . detectChanges ( ) ;
52
50
53
51
let el = fixture . debugElement . query ( By . css ( 'label' ) ) . nativeElement ;
@@ -66,8 +64,6 @@ describe('MdInputWrapper', function () {
66
64
67
65
it ( 'should treat password input type as empty at init' , ( ) => {
68
66
let fixture = TestBed . createComponent ( MdInputWrapperPasswordTestController ) ;
69
- let inputEl = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
70
- inputEl . placeholder = 'Placeholder' ;
71
67
fixture . detectChanges ( ) ;
72
68
73
69
let el = fixture . debugElement . query ( By . css ( 'label' ) ) . nativeElement ;
@@ -77,8 +73,6 @@ describe('MdInputWrapper', function () {
77
73
78
74
it ( 'should treat number input type as empty at init' , ( ) => {
79
75
let fixture = TestBed . createComponent ( MdInputWrapperNumberTestController ) ;
80
- let inputEl = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
81
- inputEl . placeholder = 'Placeholder' ;
82
76
fixture . detectChanges ( ) ;
83
77
84
78
let el = fixture . debugElement . query ( By . css ( 'label' ) ) . nativeElement ;
@@ -90,7 +84,6 @@ describe('MdInputWrapper', function () {
90
84
let fixture = TestBed . createComponent ( MdInputWrapperTextTestController ) ;
91
85
fixture . detectChanges ( ) ;
92
86
93
- let inputWrapper = fixture . debugElement . query ( By . directive ( MdInputWrapper ) ) . componentInstance ;
94
87
let inputEl = fixture . debugElement . query ( By . css ( 'input' ) ) ;
95
88
let el = fixture . debugElement . query ( By . css ( 'label' ) ) . nativeElement ;
96
89
expect ( el ) . not . toBeNull ( ) ;
@@ -99,7 +92,6 @@ describe('MdInputWrapper', function () {
99
92
inputEl . nativeElement . value = 'hello' ;
100
93
// Simulate input event.
101
94
inputEl . triggerEventHandler ( 'input' , { target : inputEl . nativeElement } ) ;
102
- inputWrapper . _inputListeners [ 'input' ] ( ) ;
103
95
fixture . detectChanges ( ) ;
104
96
105
97
el = fixture . debugElement . query ( By . css ( 'label' ) ) . nativeElement ;
@@ -263,24 +255,26 @@ describe('MdInputWrapper', function () {
263
255
} ) ;
264
256
265
257
@Component ( {
266
- template : `<md-input-wrapper><input id="test-id" placeholder="test"></md-input-wrapper>`
258
+ template : `<md-input-wrapper><input md-input id="test-id" placeholder="test"></md-input-wrapper>`
267
259
} )
268
260
class MdInputWrapperWithId { }
269
261
270
- @Component ( { template : `<md-input [disabled]="disabled"></md-input>` } )
262
+ @Component ( {
263
+ template : `<md-input-wrapper><input md-input [disabled]="disabled"></md-input-wrapper>`
264
+ } )
271
265
class MdInputWrapperWithDisabled {
272
266
disabled : boolean ;
273
267
}
274
268
275
269
@Component ( {
276
- template : `<md-input-wrapper><input required placeholder="hello"></md-input-wrapper>`
270
+ template : `<md-input-wrapper><input md-input required placeholder="hello"></md-input-wrapper>`
277
271
} )
278
272
class MdInputWrapperPlaceholderRequiredTestComponent { }
279
273
280
274
@Component ( {
281
275
template : `
282
276
<md-input-wrapper>
283
- <input>
277
+ <input md-input >
284
278
<md-placeholder>{{placeholder}}</md-placeholder>
285
279
</md-input-wrapper>`
286
280
} )
@@ -289,35 +283,35 @@ class MdInputWrapperPlaceholderElementTestComponent {
289
283
}
290
284
291
285
@Component ( {
292
- template : `<md-input-wrapper><input [placeholder]="placeholder"></md-input-wrapper>`
286
+ template : `<md-input-wrapper><input md-input [placeholder]="placeholder"></md-input-wrapper>`
293
287
} )
294
288
class MdInputWrapperPlaceholderAttrTestComponent {
295
289
placeholder : string = '' ;
296
290
}
297
291
298
292
@Component ( {
299
- template : `<md-input-wrapper><input><md-hint>{{label}}</md-hint></md-input-wrapper>`
293
+ template : `<md-input-wrapper><input md-input ><md-hint>{{label}}</md-hint></md-input-wrapper>`
300
294
} )
301
295
class MdInputWrapperHintLabel2TestController {
302
296
label : string = '' ;
303
297
}
304
298
305
299
@Component ( {
306
- template : `<md-input-wrapper [hintLabel]="label"><input></md-input-wrapper>`
300
+ template : `<md-input-wrapper [hintLabel]="label"><input md-input ></md-input-wrapper>`
307
301
} )
308
302
class MdInputWrapperHintLabelTestController {
309
303
label : string = '' ;
310
304
}
311
305
312
306
@Component ( {
313
- template : `<md-input-wrapper><input type="file"></md-input-wrapper>`
307
+ template : `<md-input-wrapper><input md-input type="file"></md-input-wrapper>`
314
308
} )
315
309
class MdInputWrapperInvalidTypeTestController { }
316
310
317
311
@Component ( {
318
312
template : `
319
313
<md-input-wrapper>
320
- <input placeholder="Hello">
314
+ <input md-input placeholder="Hello">
321
315
<md-placeholder>World</md-placeholder>
322
316
</md-input-wrapper>`
323
317
} )
@@ -326,7 +320,7 @@ class MdInputWrapperInvalidPlaceholderTestController {}
326
320
@Component ( {
327
321
template : `
328
322
<md-input-wrapper hintLabel="Hello">
329
- <input>
323
+ <input md-input >
330
324
<md-hint>World</md-hint>
331
325
</md-input-wrapper>`
332
326
} )
@@ -335,53 +329,56 @@ class MdInputWrapperInvalidHint2TestController {}
335
329
@Component ( {
336
330
template : `
337
331
<md-input-wrapper>
338
- <input>
332
+ <input md-input >
339
333
<md-hint>Hello</md-hint>
340
334
<md-hint>World</md-hint>
341
335
</md-input-wrapper>`
342
336
} )
343
337
class MdInputWrapperInvalidHintTestController { }
344
338
345
339
@Component ( {
346
- template : `<md-input-wrapper><input [(ngModel)]="model"></md-input-wrapper>`
340
+ template : `<md-input-wrapper><input md-input [(ngModel)]="model"></md-input-wrapper>`
347
341
} )
348
342
class MdInputWrapperBaseTestController {
349
343
model : any = '' ;
350
344
}
351
345
352
346
@Component ( {
353
- template : `<md-input-wrapper><input type="date" [placeholder]="placeholder"></md-input-wrapper>`
347
+ template : `
348
+ <md-input-wrapper>
349
+ <input md-input type="date" placeholder="Placeholder">
350
+ </md-input-wrapper>`
354
351
} )
355
- class MdInputWrapperDateTestController {
356
- placeholder : string = '' ;
357
- }
352
+ class MdInputWrapperDateTestController { }
358
353
359
354
@Component ( {
360
- template : `<md-input-wrapper><input type="text" placeholder="Placeholder"></md-input-wrapper>`
355
+ template : `
356
+ <md-input-wrapper>
357
+ <input md-input type="text" placeholder="Placeholder">
358
+ </md-input-wrapper>`
361
359
} )
362
360
class MdInputWrapperTextTestController { }
363
361
364
362
@Component ( {
365
363
template : `
366
364
<md-input-wrapper>
367
- <input type="password" [ placeholder]="placeholder ">
365
+ <input md-input type="password" placeholder="Placeholder ">
368
366
</md-input-wrapper>`
369
367
} )
370
- class MdInputWrapperPasswordTestController {
371
- placeholder : string = '' ;
372
- }
368
+ class MdInputWrapperPasswordTestController { }
373
369
374
370
@Component ( {
375
- template : `<md-input-wrapper><input type="number" [placeholder]="placeholder"></md-input-wrapper>`
371
+ template : `
372
+ <md-input-wrapper>
373
+ <input md-input type="number" placeholder="Placeholder">
374
+ </md-input-wrapper>`
376
375
} )
377
- class MdInputWrapperNumberTestController {
378
- placeholder : string = '' ;
379
- }
376
+ class MdInputWrapperNumberTestController { }
380
377
381
378
@Component ( {
382
379
template : `
383
380
<md-input-wrapper>
384
- <textarea [rows]="rows" [cols]="cols" [wrap]="wrap" placeholder="Snacks"></textarea>
381
+ <textarea md-input [rows]="rows" [cols]="cols" [wrap]="wrap" placeholder="Snacks"></textarea>
385
382
</md-input-wrapper>`
386
383
} )
387
384
class MdTextareaWithBindings {
0 commit comments