@@ -1694,8 +1694,8 @@ var VALID_CLASS = 'ng-valid',
1694
1694
*
1695
1695
*
1696
1696
*/
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 ) {
1699
1699
this . $viewValue = Number . NaN ;
1700
1700
this . $modelValue = Number . NaN ;
1701
1701
this . $validators = { } ;
@@ -1712,7 +1712,6 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1712
1712
this . $error = { } ; // keep invalid keys here
1713
1713
this . $$success = { } ; // keep valid keys here
1714
1714
this . $pending = undefined ; // keep pending keys here
1715
- this . $name = $interpolate ( $attr . name || '' , false ) ( $scope ) ;
1716
1715
1717
1716
1718
1717
var parsedNgModel = $parse ( $attr . ngModel ) ,
@@ -1738,8 +1737,9 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1738
1737
}
1739
1738
} ;
1740
1739
1741
- this . $$setOptions = function ( options ) {
1740
+ this . $$init = function ( options , name ) {
1742
1741
ctrl . $options = options ;
1742
+ ctrl . $name = name ;
1743
1743
1744
1744
if ( ! parsedNgModel . assign && ( ! options || ! options . getterSetter ) ) {
1745
1745
throw $ngModelMinErr ( 'nonassign' , "Expression '{0}' is non-assignable. Element: {1}" ,
@@ -2434,7 +2434,7 @@ var ngModelDirective = function() {
2434
2434
var modelCtrl = ctrls [ 0 ] ,
2435
2435
formCtrl = ctrls [ 1 ] || nullFormCtrl ;
2436
2436
2437
- modelCtrl . $$setOptions ( ctrls [ 2 ] && ctrls [ 2 ] . $options ) ;
2437
+ modelCtrl . $$init ( ctrls [ 2 ] && ctrls [ 2 ] . $options , attr . name ) ;
2438
2438
2439
2439
// notify others, especially parent forms
2440
2440
formCtrl . $addControl ( modelCtrl ) ;
0 commit comments