@@ -23,10 +23,10 @@ angular.module('ui.bootstrap.rating', [])
23
23
24
24
this . stateOn = angular . isDefined ( $attrs . stateOn ) ? $scope . $parent . $eval ( $attrs . stateOn ) : ratingConfig . stateOn ;
25
25
this . stateOff = angular . isDefined ( $attrs . stateOff ) ? $scope . $parent . $eval ( $attrs . stateOff ) : ratingConfig . stateOff ;
26
- var tmpTitles = angular . isDefined ( $attrs . titles ) ? $scope . $parent . $eval ( $attrs . titles ) : ratingConfig . titles ;
26
+ var tmpTitles = angular . isDefined ( $attrs . titles ) ? $scope . $parent . $eval ( $attrs . titles ) : ratingConfig . titles ;
27
27
this . titles = angular . isArray ( tmpTitles ) && tmpTitles . length > 0 ?
28
28
tmpTitles : ratingConfig . titles ;
29
-
29
+
30
30
var ratingStates = angular . isDefined ( $attrs . ratingStates ) ?
31
31
$scope . $parent . $eval ( $attrs . ratingStates ) :
32
32
new Array ( angular . isDefined ( $attrs . max ) ? $scope . $parent . $eval ( $attrs . max ) : ratingConfig . max ) ;
@@ -39,15 +39,15 @@ angular.module('ui.bootstrap.rating', [])
39
39
}
40
40
return states ;
41
41
} ;
42
-
42
+
43
43
this . getTitle = function ( index ) {
44
44
if ( index >= this . titles . length ) {
45
45
return index + 1 ;
46
46
} else {
47
47
return this . titles [ index ] ;
48
48
}
49
49
} ;
50
-
50
+
51
51
$scope . rate = function ( value ) {
52
52
if ( ! $scope . readonly && value >= 0 && value <= $scope . range . length ) {
53
53
ngModelCtrl . $setViewValue ( ngModelCtrl . $viewValue === value ? 0 : value ) ;
@@ -109,10 +109,10 @@ angular.module('ui.bootstrap.rating')
109
109
$log . warn ( 'RatingController is now deprecated. Use UibRatingController instead.' ) ;
110
110
}
111
111
112
- return $controller ( 'UibRatingController' , {
112
+ angular . extend ( this , $controller ( 'UibRatingController' , {
113
113
$scope : $scope ,
114
114
$attrs : $attrs
115
- } ) ;
115
+ } ) ) ;
116
116
} ] )
117
117
118
118
. directive ( 'rating' , [ '$log' , '$ratingSuppressWarning' , function ( $log , $ratingSuppressWarning ) {
0 commit comments