无法在字符串"Information Technology" angularjs上创建"selected"属性 [英] Cannot create property 'selected' on string 'Information Technology' angularjs

查看:202
本文介绍了无法在字符串"Information Technology" angularjs上创建"selected"属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的控制器

This is my controller

 $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"];

这是我绑定数据的视图

This is my view where i am binding data

 <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'请帮助!

Its giving me the error that 'cannot bind property selected to string xyz' Please help!!!

推荐答案

subjects是一个字符串数组,不具有您要绑定到输入的属性selected.

subjects is an array of strings, which don't have the property selected that you're trying to bind to your input.

这篇关于无法在字符串"Information Technology" angularjs上创建"selected"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆