根据uib文档 rating 实现简单的星星评分,页面上有多个rating的时候怎么统计总分呢??
html部分:
<table class="table table-striped table-bordered table-hover table-style">
<tr class="s-table-head">
<td class="modal-common-head">{{data1.module}}</td>
<td>得分</td>
<td><b>总分:{{}}/25</b></td>
</tr>
<tr ng-repeat="item in data1.options" class="s-table-body">
<td class="question">{{item.option}}</td>
<td>
<span uib-rating ng-model="rate" max="max" on-hover="hoveringOver(value)" on-leave="overStar = null" titles="['1分','2分','3分','4分','5分']" aria-labelledby="default-rating" ></span>
</td>
<td>{{rate}}</td>
</tr>
</table>
js部分:
$scope.rate = 0;
$scope.max = 5;
$scope.hoveringOver = function(value) {
$scope.overStar = value;
};
$scope.data1 = {
module: "一般礼仪方面",
options: [{
option: "问题1",
score: ""
}, {
option: "问题2",
score: ""
}, {
option: "问题3",
score: ""
}, {
option: "问题4",
score: ""
}, {
option: "问题5",
score: ""
}]
};
附图:uib-rating参数说明