7
AngularJS-将单选按钮绑定到具有布尔值的模型
我在将单选按钮绑定到其属性具有布尔值的对象时遇到问题。我正在尝试显示从$ resource获取的考试题。 HTML: <label data-ng-repeat="choice in question.choices"> <input type="radio" name="response" data-ng-model="choice.isUserAnswer" value="true" /> {{choice.text}} </label> JS: $scope.question = { questionText: "This is a test question.", choices: [{ id: 1, text: "Choice 1", isUserAnswer: false }, { id: 2, text: "Choice 2", isUserAnswer: true }, { id: 3, text: "Choice 3", …