@@ -75,25 +75,23 @@ const controlNameBinding =
7575@Directive ( {
7676 selector : '[ng-control]' ,
7777 hostInjector : [ controlNameBinding ] ,
78- properties : [ 'name: ng-control ' , 'model: ng-model ' ] ,
79- events : [ 'ngModel' ] ,
78+ properties : [ 'name: ngControl ' , 'model: ngModel ' ] ,
79+ events : [ 'update: ngModel' ] ,
8080 lifecycle : [ onDestroy , onChange ] ,
8181 exportAs : 'form'
8282} )
8383export class NgControlName extends NgControl {
8484 _parent : ControlContainer ;
85- ngModel : EventEmitter ;
85+ update = new EventEmitter ( ) ;
8686 model : any ;
8787 ngValidators : QueryList < NgValidator > ;
88- _added : boolean ;
88+ _added = false ;
8989
9090 // Scope the query once https://github.com/angular/angular/issues/2603 is fixed
9191 constructor ( @Ancestor ( ) parent : ControlContainer ,
9292 @Query ( NgValidator ) ngValidators : QueryList < NgValidator > ) {
9393 super ( ) ;
9494 this . _parent = parent ;
95- this . ngModel = new EventEmitter ( ) ;
96- this . _added = false ;
9795 this . ngValidators = ngValidators ;
9896 }
9997
@@ -109,7 +107,7 @@ export class NgControlName extends NgControl {
109107
110108 onDestroy ( ) { this . formDirective . removeControl ( this ) ; }
111109
112- viewToModelUpdate ( newValue : any ) : void { ObservableWrapper . callNext ( this . ngModel , newValue ) ; }
110+ viewToModelUpdate ( newValue : any ) : void { ObservableWrapper . callNext ( this . update , newValue ) ; }
113111
114112 get path ( ) : List < string > { return controlPath ( this . name , this . _parent ) ; }
115113
0 commit comments