@@ -1728,8 +1728,8 @@ is set to `true`. The parse error is stored in `ngModel.$error.parse`.
1728
1728
*
1729
1729
*
1730
1730
*/
1731
- var NgModelController = [ '$scope' , '$exceptionHandler' , '$attrs' , '$element' , '$parse' , '$animate' , '$timeout' , '$rootScope' , '$q' , '$interpolate' ,
1732
- function ( $scope , $exceptionHandler , $attr , $element , $parse , $animate , $timeout , $rootScope , $q , $interpolate ) {
1731
+ var NgModelController = [ '$scope' , '$exceptionHandler' , '$attrs' , '$element' , '$parse' , '$animate' , '$timeout' , '$rootScope' , '$q' ,
1732
+ function ( $scope , $exceptionHandler , $attr , $element , $parse , $animate , $timeout , $rootScope , $q ) {
1733
1733
this . $viewValue = Number . NaN ;
1734
1734
this . $modelValue = Number . NaN ;
1735
1735
this . $$rawModelValue = undefined ; // stores the parsed modelValue / model set from scope regardless of validity.
@@ -1747,7 +1747,6 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1747
1747
this . $error = { } ; // keep invalid keys here
1748
1748
this . $$success = { } ; // keep valid keys here
1749
1749
this . $pending = undefined ; // keep pending keys here
1750
- this . $name = $interpolate ( $attr . name || '' , false ) ( $scope ) ;
1751
1750
1752
1751
1753
1752
var parsedNgModel = $parse ( $attr . ngModel ) ,
@@ -1757,8 +1756,10 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
1757
1756
pendingDebounce = null ,
1758
1757
ctrl = this ;
1759
1758
1760
- this . $$setOptions = function ( options ) {
1759
+ this . $$init = function ( options , name ) {
1761
1760
ctrl . $options = options ;
1761
+ ctrl . $name = name ;
1762
+
1762
1763
if ( options && options . getterSetter ) {
1763
1764
var invokeModelGetter = $parse ( $attr . ngModel + '()' ) ,
1764
1765
invokeModelSetter = $parse ( $attr . ngModel + '($$$p)' ) ;
@@ -2527,7 +2528,7 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
2527
2528
var modelCtrl = ctrls [ 0 ] ,
2528
2529
formCtrl = ctrls [ 1 ] || nullFormCtrl ;
2529
2530
2530
- modelCtrl . $$setOptions ( ctrls [ 2 ] && ctrls [ 2 ] . $options ) ;
2531
+ modelCtrl . $$init ( ctrls [ 2 ] && ctrls [ 2 ] . $options , attr . name ) ;
2531
2532
2532
2533
// notify others, especially parent forms
2533
2534
formCtrl . $addControl ( modelCtrl ) ;
0 commit comments