gpt4 book ai didi

javascript - ionic.bundle.js :25642 Error: [ngRepeat:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got 'cdata.catagoriesdata'

转载 作者:行者123 更新时间:2023-12-02 14:03:51 44 4
gpt4 key购买 nike

我正在尝试创建一个 ionic 移动应用程序,因为我在 ng-repeat 中遇到错误,错误是

ionic.bundle.js:25642 Error: [ngRepeat:iexp] Expected expression in form of 'item in collection[ track by id]' but got 'cdata.catagoriesdata'

请任何人帮我解决这个问题,然后我在下面添加了我的代码

.controller('categoriesdatactrl', ['$scope', '$stateParams', // The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
// You can include any angular dependencies as parameters for this function
// TIP: Access Route Parameters for your page via $stateParams.parameterName
function ($scope, $stateParams) {
$scope.catagoriesdata=[{"title":"anandan"},{"title":"anandan1"}];

}])
<ion-view title="Categories" id="page3">
<ion-content padding="true" class="has-header">

<ion-list id="categories-list2" ng-repeat="cdata.catagoriesdata">
<ion-item class="item-thumbnail-left assertive" id="categories-list-item20" >

<h2>{{cdata.title}}</h2>
</ion-item>

</ion-list>
</ion-content>
</ion-view>

最佳答案

像这样改变你的 ng-repeat

ng-repeat="cdata in catagoriesdata track by $index"

关于javascript - ionic.bundle.js :25642 Error: [ngRepeat:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got 'cdata.catagoriesdata' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40212463/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com