Starting to use Angular and playing with a demo. In the model, the event item includes a start time called starts_at and a title.
I had a tag using ng-repeat="event in events track by $index" and tried adding in "|orderBy: event.starts_at" It didn't seem to influence the sorting in any way until I removed the track section.
Does track disables any option for sorting in angular ?
According to docs: https://docs.angularjs.org/api/ng/directive/ngRepeat filter expressions (and I suspect, order) come before tracking expressions.
Example:
item in items | filter:searchText track by item.id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With