ng-repeat无法解析阿拉伯语对象

ng-repeat unable to parse arabic object

本文关键字:阿拉伯语 对象 ng-repeat      更新时间:2023-09-26

我正在创建一个基于阿拉伯语内容的json对象,如下所示

$scope.arabicContent = ["ردهة","قاعة الاجتماعات","مبرمجين الجوال","المدراء","المحاسبة","المحاسبة","المبرمجين","مطبخ ","الطابق الأول"]

但是ng-repeat无法在html端解析/迭代这个对象

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

试图在 plunker 中ng-repeat阿拉伯语数组,我得到的错误是[ngRepeat:dupes] Duplicates in a repeater are not allowed .所以,对我来说,看起来该数组中有重复的文本(我可能是错的)。

该错误的解决方案是告诉ng-repeat按索引而不是内容进行跟踪。

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

这是褶皱:https://plnkr.co/edit/uaIzf5Xty9o0GpIMdW0x?p=preview