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