2016-01-24 70 views
0

我基于阿拉伯内容如下创建一个JSON对象NG-重复无法解析阿拉伯语对象

$ scope.arabicContent =“大堂”,“会议室”,“移动的程序员”,“经理人” ,“会计”,“会计学”,“程序员”,“厨房”,“第一楼”]

但NG重复不能够解析/ HTML在迭代方此对象

<select name="meetingLocation" ng-model="data.meetingLocation"> <option ng-repeat="location in arabicContent" value="{{ location }}">{{ location }}</option> </select> 

回答

3

通过在PL中的阿拉伯阵列试过ng-repeat unker和我得到的错误是[ngRepeat:dupes] Duplicates in a repeater are not allowed。所以,对我来说,它看起来像有数组(我可能是错的),在复制的文本。

解决这个错误是告诉ng-repeat来跟踪指数,而不是内容。

ng-repeat="arabic in arabicContent track by $index"

这里的plunker:https://plnkr.co/edit/uaIzf5Xty9o0GpIMdW0x?p=preview

+0

你是对的,我能够解决这个问题。由于 –

+0

很好听! – Chanthu