我猜测我的成像错误。我不确定错误的来源。
注意:有时候工作顺利,我经常遇到这个错误。
形式:
<div class="wrapper" ng-app='afApp' ng-controller='afController'
style="background: #F8F8F8;padding-top: 10px;">
<div class="container-fluid">
<div class="row">
<input type="search" size="40" ng-model="search" id="search"
autofocus="autofocus" autocomplete="off">
<section ng-repeat="afData in afLoad | filter:search | limitTo:10"
ng-show='search' md-highlight-text="search">
<div class="row">
<div class="col-sm-6 text-center">
<h2>{{afData.yil}}</h2>
<h3>{{afData.sik1}}</h3>
</div>
<div class="col-sm-6">
<p>{{afData.soru}}</p>
</div>
</div>
</section>
</div>
</div>
</div>
控制台[浏览器]:
错误:[ngRepeat:dupes] http://errors.angularjs.org/1.2.15/ngRepeat/dupes?p0=afData%20in%20afLoad%20%7C%20filter%3Asearch%20%7C%20limitTo%3A10&p1=string%3A%3C
控制台[SSH]:
(node:4015)[DEP0096] DeprecationWarning:timers.unenroll()是 弃用。请改用clearTimeout。
答案 0 :(得分:1)
我会按错误中的说明使用曲目。在ng-repeat中的某些时刻,必须有不唯一的对象。
以下内容应该足够了:
ng-repeat="afData in afLoad | filter:search | limitTo:10 track by $index"
https://docs.angularjs.org/api/ng/directive/ngRepeat#tracking-and-duplicates