Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Collection-repeat with orderBy, filter and track by not working

$
0
0

@mvdv wrote:

Hi everyone

I'm trying to display a list of movies, ordered by "listed_at" (in reverse) there's also a search on top hence the filter.

Now I'm also adding an ion-option-button which makes the list item swipeable to show a remove button.
The remove button calls a function which makes an API call to remove the movie from the list (this works), the list should also be updated to reflect te removal of the item. So I also pass the $index of the movie item and splice the movies array to remove it.

The "track by" should automatically update the list when an item is spliced.

Here's the collection-repeat I'm using:
<ion-item collection-repeat="item in movies | orderBy:'listed_at':true | filter:search track by $index" class="item-thumbnail-left item-icon-right" href="#">

Here the "track by" doesn't seem to work (after removing a movie, the list isn't updated)

When I try collection-repeat without the orderBy it does work:
<ion-item collection-repeat="item in movies | filter:search track by $index" class="item-thumbnail-left item-icon-right" href="#">

What's going on here? Is this a bug?

Any help welcome!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles