Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
Common use of NG repeat:
<div class="form-group" ng-repeat="item in items"></div>
But there is a situation in this case, that is, error: [NgR] epeat:dupes ]Wrong
ng-repeat does not allow as like as two peas of two data
.
This kind of situation will report an error
$scope.items = [1,1,1,1,2,2,2,2];
Solution:
<div class="form-group" ng-repeat="item in items track by $index"></div>
Add “track by $Index” to solve this problem
But after that, there will be a problem. If you have input fields in ng repeat, and you use ng model = “item. XX”
Repeat the value, as long as you modify any one of them, others will also change with it
Similar Posts:
- AngluarJs Error: [ngR epeat:dupes ]Solutions
- When using angularjs procedure, track by $index of NG repeat
- Can read property ‘indexof’ of undefined
- Vue3’s use of reactive/torefs + V-model leads to the failure of response and the failure of El form input
- El Form Verification Error: [XXX] is not a string [How to Solve]
- Front end development: solve the problem of emitted value instead of an instance of error in Vue project
- Example of Django model unique together
- tf.data.Dataset.from_tensor_slices: How to Use shuffle(), repeat(), batch()
- [DOM] Input elements should have autocomplete attributes (suggested: autocomplete=’tel’, …
- Error: not a group by expression [How to Solve]