coffeescript / angular问题中的radiobutton列表

时间:2015-04-09 03:10:02

标签: javascript angularjs coffeescript

我正试图在coffeescript中显示一个radiobutton列表,如下所示:

  label(ng-repeat="p in priorities")
                    input(type="radio" ng-model="goal.priorityScore" value="p")

优先顺序是:

  $scope.priorities=['Hi','Med','Lo']

然而,优先级显示一堆单选按钮,但每个按钮后没有优先级文本?

1 个答案:

答案 0 :(得分:0)

更新您的代码

 label(ng-repeat="p in priorities")
 input(type="radio" ng-model="goal.priorityScore" value="p")


    label(ng-repeat="p in priorities") input(type="radio" ng-model="goal.priorityScore" value="{{p}}")

或者

 label(ng-repeat="p in priorities")
 input(type="radio" ng-model="goal.priorityScore" value="{{p}}") {{p}}`

希望它有效