分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

【angularjs基础】ng-repeat嵌套循环报错angular.min.js:89 Error: [ngRepeat:dupes]

发布时间:2023-09-06 01:12责任编辑:彭小芳关键词:js

再写嵌套循环的时候,提示一个错误

angular.min.js:89 Error: [ngRepeat:dupes]

代码如下

<table class="GridViewTable mtop5px " style="margin-top: 15px;" id="tabVipHallRegisterList" ng-app="" ng-controller="JSJ.CRM.AppFeedBackList.RequestData"> ???????<tr class="text_center"> ???????????<th style="width: 60px">编号</th> ???????????<th style="width: 80px">会员姓名</th> ???????????<th style="width: 80px">手机号</th> ???????????<th style="width: 150px">反馈内容</th> ???????????<th style="width: 80px">反馈时间</th> ???????????<th style="width: 80px">公司</th> ???????????<th style="width: 80px">问题类型</th> ???????????<th style="width: 80px">上传图片</th> ???????????<th style="width: 80px">消息类型</th> ???????????<th style="width: 90px">消息来源</th> ???????????<th style="width: 150px">答复内容</th> ???????????<th style="width: 80px">答复时间</th> ???????????<th style="width: 100px">反馈奖励</th> ???????????<th style="width: 50px">操作</th> ???????</tr> ???????<tr class="text_center" ng-repeat="x in AppFeedBackList | orderBy:orderProp"> ???????????<td ng-bind="x.CommentsID"></td> ???????????<td ng-bind="x.CustomerName"></td> ???????????<td ng-bind="x.Telephone"></td> ???????????<td ng-bind="x.CommentsS" onclick="ShowDetailContent(this)" onmouseover="ShowDetailContent(this)" @*onmouseout="layer.closeAll();"*@ detailcontent="{{x.Comments}}"></td> ???????????<td ng-bind="x.CreateTime"></td> ???????????<td ng-bind="x.QuestionSourceFromDsec"></td> ???????????<td ng-bind="x.QuestionTypeDsec"></td> ???????????<td> ???????????????<span ng-repeat="i in x.ListImageUrl"> ???????????????????<img src="{{i}}" style="width:45px;height:45px;" onclick=‘ShowImage(this)‘ url="{{i}}" /> ???????????????</span> ???????????</td> ???????????<td ng-bind="x.MessageType"></td> ???????????<td ng-bind="x.SourceWay"></td> ???????????<td> ???????????????<input ng-if="x.IsReply" type="button" p="{{ x.CommentsID }}" style="width:50%;" comments="{{x.Comments}}" jsjid="{{x.JSJID}}" value="答复" name="btnReply" /> ???????????????<label ng-if="!x.IsReply" onclick="ShowDetailContent(this)" onmouseover="ShowDetailContent(this)" @*onmouseout="layer.closeAll();"*@ detailcontent="{{x.ReplayContent}}">{{x.ReplayContentS}}</label> ???????????</td> ???????????<td ng-bind="x.ReplayTime"></td> ???????????<td> ???????????????<input ng-if="x.IsTake" type="button" name="btnReward" p="{{ x.CommentsID }}" style="width:50%;" comments="{{x.Comments}}" jsjid="{{x.JSJID}}" value="奖励" /> ???????????????<label ng-if="!x.IsTake">{{x.RewardTips}}</label> ???????????</td> ???????????<td> ???????????????<input type="button" name="btnDel" style="width:80%;" p="{{ x.CommentsID }}" value="删除" /> ???????????</td> ???????</tr> ???</table>

报错截图

跟踪原因

http://blog.csdn.net/ligang2585116/article/details/50490307

解决方案

在对应的ng-repeat指令中增加track by $index

修改代码

<td> ???????????????<span ng-repeat="i in x.ListImageUrl track by $index"> ???????????????????<img src="{{i}}" style="width:45px;height:45px;" onclick=‘ShowImage(this)‘ url="{{i}}" /> ???????????????</span> ???????????</td>

最后可以在同一行,生成多个图片标签

搞定!

【angularjs基础】ng-repeat嵌套循环报错angular.min.js:89 Error: [ngRepeat:dupes]

原文地址:http://www.cnblogs.com/jhli/p/7543655.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved