Angularjs 如何使用ui.bootstrap获得平均星级?

Angularjs 如何使用ui.bootstrap获得平均星级?,angularjs,angular-ui-bootstrap,rating,Angularjs,Angular Ui Bootstrap,Rating,angular.module('ui.bootstrap.demo',['ngAnimate','ngSanitize','ui.bootstrap']); angular.module('ui.bootstrap.demo')。controller('RatingDemoCtrl',function($scope){ $scope.rate=7.2; $scope.max=10; $scope.isReadonly=false; $scope.hoveringOver=函数(值){ $scop

angular.module('ui.bootstrap.demo',['ngAnimate','ngSanitize','ui.bootstrap']);
angular.module('ui.bootstrap.demo')。controller('RatingDemoCtrl',function($scope){
$scope.rate=7.2;
$scope.max=10;
$scope.isReadonly=false;
$scope.hoveringOver=函数(值){
$scope.overStar=值;
$scope.percent=100*(值/$scope.max);
};
$scope.ratingStates=[
{stateOn:'glyphicon ok sign',stateOff:'glyphicon ok circle'},
{stateOn:'glyphicon star',stateOff:'glyphicon star empty'},
{stateOn:'glyphicon heart',stateOff:'glyphicon ban circle'},
{stateOn:'glyphicon heart'},
{stateOff:'glyphicon off'}
];
});

违约
{{percent}}}%
速率:{Rate}}-Readonly是:{isReadonly}-悬停在:{{overStar | |“none”}

平均值是多少?你们这里似乎只有一个评级栏……问题不清楚。您可以添加更多详细信息吗?@Sinchan在这种情况下,您应该
Math.round()
ceil/floor
您根据requirements@Sinchan我认为使用
uib评级是不可能的。使用angularjs还有其他选择吗?