Angularjs ng-model数组对象

时间:2014-04-29 10:12:16

标签: html angularjs

我正在使用角度js,由于某种原因我无法在模型中保存数组。

这是我的代码:

<input type="checkbox" ng-model="dataObject.orientation_competency['57']" value="57" name="orientation_competency[]" rel="orientation" data-count="3" class="ng-pristine ng-valid">
<input type="checkbox" ng-model="dataObject.orientation_competency['58']" value="58" name="orientation_competency[]" rel="orientation" data-count="3" class="ng-pristine ng-valid">
<input type="checkbox" ng-model="dataObject.orientation_competency['59']" value="59" name="orientation_competency[]" rel="orientation" data-count="3" class="ng-pristine ng-valid">

当我尝试点击复选框时,它会抛出错误:

  

错误:Xa(...)未定义   Ya.prototype.objectIndex /&LT; .assign @ http://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:162   cehttp://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:174   Lc.checkbox / HTTP://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:171   。BD /这$ gethttp://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:102   。BD /这$ gethttp://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:103   Lc.checkbox /&LT; @ http://soller.local/wp-content/themes/talentojo/web/js/v2/angular/angular.js:171   x.event.dispatch@http://codeorigin.jquery.com/jquery-2.0.3.min.js:5   x.event.add / y.handle @ http://codeorigin.jquery.com/jquery-2.0.3.min.js:5

     

http://soller.local/wp-content/themes/talentojo/web/js/v2/tinymce/themes/modern/theme.js   第84行

0 个答案:

没有答案