在angular.js 1.x中使用ng-repeat的问题

时间:2017-08-04 13:37:09

标签: angularjs

我正在使用选择(jquery包装器选择)并使用ng-repeat绑定对象数组,如下所示。

abc.js

var contactArray = [{"Id": 1, "FullName": "speaker test_user 1"},
                    {"Id": 2,"FullName": "speaker test_user 2"},
                    {"Id": 3,"FullName": "speaker test_user 3"}
                   ]

abc.html

<option ng-repeat="option in contactArray" value="{{option.Id}}">{{option.FullName}}</option>

当我在浏览器中加载页面时,它会按如下方式呈现数组。

enter image description here

它正确地渲染了前两个记录,但在最后一个记录中它呈现了键值。

speaker test_user 1
speaker test_user 2
{{option.FullName}}

我不知道为什么它呈现 {{option.FullName}} 而不是它的值。要么这是一个选择或有角度的问题。

我已经在github中看到了所有选择的问题,但之前没有报道。

任何帮助都将不胜感激。

0 个答案:

没有答案