【发布时间】:2016-09-11 15:18:18
【问题描述】:
这是我的控制器
$scope.subjects = ["Computer Security", "Graphics and Multimedia", "Networks", "Computer Science and Engineering", "Game Design", "Programming", "Information Technology", "Software Engineering", "Technology Management", "Telecommunications", "Web Development", "Sociology", "Psychology", "General", "Social Work", "Criminal Justice", "Law and Paralegal", "Public Safety", "Forensic Sciences", "Counseling", "Homeland Security", "Political Science", "Public Administration"];
这是我绑定数据的视图
<label class="concentration-label3" ng-repeat="value in subjects">
<input ng-model="value.selected" ng-disabled="subjectCheckedCount == subjectLimit && !value.selected" type="checkbox" name="concentrations" class="concentration-label3__input js-concentration-value" value="{{value}}" data-mixpanel-subject="Design" >
<span class="concentration-label3__title" for="conc1">
{{value}}
<span class="concentration-label3__title__checkmark4"></span>
</span>
</label>
它给了我“无法将选择的属性绑定到字符串”的错误 xyz'请帮忙!!!
【问题讨论】:
-
plnkr.co/edit/cdwY1EzKRAL0qlwC9eyO?p=preview 。它为我工作,它看起来像不同的原因
-
它也为我绑定了数据,但是在我的 $scope.$watch 函数中,当我尝试获取属性 value.selected 时,它会在控制台中显示“无法在字符串上创建属性”错误..
-
请添加观看脚本
标签: javascript angularjs angularjs-ng-repeat