Skip to content Skip to sidebar Skip to footer

Ngrepeat:dupes Even With Track By $index (special Case)

Brief background:- Am building a social networking site and am storing the statuses and users with MongoDB. So u have a status like this for example { 'status' : 'Hello world.'

Solution 1:

@BuddistBeast comment (underneath my question) lead me in the right path to fixing my problem. I ended up adding https://github.com/a8m/angular-filter plugin and using its "unique" filter provided therein. That fixed the ngRepeat dupes errors showing up. But then, I'd still see duplicated statuses appearing for some reason (but no error on the console). So if i post "hi" for example, i would see "hi" appearing twice. I did manage to fix it altogether, but the fix to that problem is separate and beyond the scope of this question.

Solution 2:

Try:

<li ng-repeat="status in statuses track by $index | isUserStatus " ng-show="status.active" class="user-status-bland">

or:

<li ng-repeat="status in statuses | isUserStatus track by $index" ng-show="status.active" class="user-status-bland">

Solution 3:

Try to track by $id(status) it might solve your issue

Post a Comment for "Ngrepeat:dupes Even With Track By $index (special Case)"