@@ -1694,8 +1694,8 @@ var VALID_CLASS = 'ng-valid',
16941694 *
16951695 *
16961696 */
1697- var NgModelController = [ '$scope' , '$exceptionHandler' , '$attrs' , '$element' , '$parse' , '$animate' , '$timeout' , '$rootScope' , '$q' , '$interpolate' ,
1698- function ( $scope , $exceptionHandler , $attr , $element , $parse , $animate , $timeout , $rootScope , $q , $interpolate ) {
1697+ var NgModelController = [ '$scope' , '$exceptionHandler' , '$attrs' , '$element' , '$parse' , '$animate' , '$timeout' , '$rootScope' , '$q' ,
1698+ function ( $scope , $exceptionHandler , $attr , $element , $parse , $animate , $timeout , $rootScope , $q ) {
16991699 this . $viewValue = Number . NaN ;
17001700 this . $modelValue = Number . NaN ;
17011701 this . $validators = { } ;
@@ -1712,7 +1712,6 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
17121712 this . $error = { } ; // keep invalid keys here
17131713 this . $$success = { } ; // keep valid keys here
17141714 this . $pending = undefined ; // keep pending keys here
1715- this . $name = $interpolate ( $attr . name || '' , false ) ( $scope ) ;
17161715
17171716
17181717 var parsedNgModel = $parse ( $attr . ngModel ) ,
@@ -1738,8 +1737,9 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
17381737 }
17391738 } ;
17401739
1741- this . $$setOptions = function ( options ) {
1740+ this . $$init = function ( options , name ) {
17421741 ctrl . $options = options ;
1742+ ctrl . $name = name ;
17431743
17441744 if ( ! parsedNgModel . assign && ( ! options || ! options . getterSetter ) ) {
17451745 throw $ngModelMinErr ( 'nonassign' , "Expression '{0}' is non-assignable. Element: {1}" ,
@@ -2434,7 +2434,7 @@ var ngModelDirective = function() {
24342434 var modelCtrl = ctrls [ 0 ] ,
24352435 formCtrl = ctrls [ 1 ] || nullFormCtrl ;
24362436
2437- modelCtrl . $$setOptions ( ctrls [ 2 ] && ctrls [ 2 ] . $options ) ;
2437+ modelCtrl . $$init ( ctrls [ 2 ] && ctrls [ 2 ] . $options , attr . name ) ;
24382438
24392439 // notify others, especially parent forms
24402440 formCtrl . $addControl ( modelCtrl ) ;
0 commit comments