在angularjs中实现评级

时间:2016-09-16 07:53:47

标签: angularjs numbers rating

我正在尝试在角度js中进行评级实施。我有一颗星星,点击星星,我应该在圆形水平条内显示数字(1,2,3)。现在说如果我从这个栏中点击2,则应该通过隐藏水平条返回数字2。请帮我这样做。我试过如下显示明星。但不确定如何实现这个星上的数字吧。 我能够找到与星级相关的查询,但没有关于这个特定情况的信息。

以下代码显示星形图标。我需要做的就是在单击此星形图标时将水平条与数字相关联。如果可以为我提供一些如何做到这一点的指导

会很棒
<div style="float:left;clear:both;padding-top:2px">
    <b style="font-weight:400">
        <i class="icon ion-ios-star-outline tabfont" style="font-size:25px;color:#443D6F"></i>
        <div class="wrapper"></div>
    </b>
</div>

添加控制器代码:

.controller('QuestionaireCtrl', function($scope) {
  $scope.heading = "Questionaire";
  // $scope.rating = true;
  // $scope.responses = {    
  //   "q1":"",
  //   "rating":0
  // };
  $scope.ratingData = {
   "CISCO":{
      "headcount":"30",
      "questions":{
         "Contractual/Commercial Aspects":[
            {
               "question":"SLA/SLO is reported on time, everytime?",
               "rating":"1"
            },
            {
               "question":"Test outcomes are aligned with Contractual commitments?",
               "rating":"2"
            },
            {
               "question":"Test scope is clear and baselined?",
               "rating":"2"
            },
            {
               "question":"Contractual Dependencies with respect to  resource, infrastructure, Schedule and costs are defined and managed?",
               "rating":"3"
            },
            {
               "question":"Contractual commitments and base solution are understood by the Delivery team?",
               "rating":"2"
            },
            {
               "question":"Productivity commitments are delivered to the client?",
               "rating":"2"
            },
            {
               "question":"Profitability and revenue improvement opportunities are continuously identified?",
               "rating":"2"
            }
         ],

0 个答案:

没有答案