@@ -623,7 +623,7 @@ describe('MdInputContainer', function () {
623
623
component = groupFixture . componentInstance ;
624
624
containerEl = groupFixture . debugElement . query ( By . css ( 'md-input-container' ) ) . nativeElement ;
625
625
626
- expect ( component . formControl . invalid ) . toBe ( true , 'Expected form control to be invalid' ) ;
626
+ expect ( component . formGroup . invalid ) . toBe ( true , 'Expected form control to be invalid' ) ;
627
627
expect ( containerEl . querySelectorAll ( 'md-error' ) . length ) . toBe ( 0 , 'Expected no error messages' ) ;
628
628
expect ( component . formGroupDirective . submitted )
629
629
. toBe ( false , 'Expected form not to have been submitted' ) ;
@@ -955,9 +955,9 @@ class MdInputContainerWithFormErrorMessages {
955
955
956
956
@Component ( {
957
957
template : `
958
- <form [formGroup]="formGroup" (ngSubmit)="onSubmit()" novalidate>
958
+ <form [formGroup]="formGroup" novalidate>
959
959
<md-input-container>
960
- <input mdInput [formControl]="formControl ">
960
+ <input mdInput formControlName="name ">
961
961
<md-hint>Please type something</md-hint>
962
962
<md-error>This field is required</md-error>
963
963
</md-input-container>
@@ -966,7 +966,7 @@ class MdInputContainerWithFormErrorMessages {
966
966
} )
967
967
class MdInputContainerWithFormGroupErrorMessages {
968
968
@ViewChild ( FormGroupDirective ) formGroupDirective : FormGroupDirective ;
969
- onSubmit ( ) { }
970
- formControl = new FormControl ( '' , Validators . required ) ;
971
- formGroup = new FormGroup ( { name : this . formControl } ) ;
969
+ formGroup = new FormGroup ( {
970
+ name : new FormControl ( '' , Validators . required )
971
+ } ) ;
972
972
}
0 commit comments