@@ -620,7 +620,7 @@ describe('MdInputContainer', function () {
620620 component = groupFixture . componentInstance ;
621621 containerEl = groupFixture . debugElement . query ( By . css ( 'md-input-container' ) ) . nativeElement ;
622622
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' ) ;
624624 expect ( containerEl . querySelectorAll ( 'md-error' ) . length ) . toBe ( 0 , 'Expected no error messages' ) ;
625625 expect ( component . formGroupDirective . submitted )
626626 . toBe ( false , 'Expected form not to have been submitted' ) ;
@@ -951,9 +951,9 @@ class MdInputContainerWithFormErrorMessages {
951951
952952@Component ( {
953953 template : `
954- <form [formGroup]="formGroup" (ngSubmit)="onSubmit()" novalidate>
954+ <form [formGroup]="formGroup" novalidate>
955955 <md-input-container>
956- <input mdInput [formControl]="formControl ">
956+ <input mdInput formControlName="name ">
957957 <md-hint>Please type something</md-hint>
958958 <md-error>This field is required</md-error>
959959 </md-input-container>
@@ -962,9 +962,9 @@ class MdInputContainerWithFormErrorMessages {
962962} )
963963class MdInputContainerWithFormGroupErrorMessages {
964964 @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+ } ) ;
968968}
969969
970970/**
0 commit comments