I'm using the angular ng-flow component for file upload and it's working great besides a few nuances. I'd love to be able to have the new files that I try to upload put on the top of the list rather than on the bottom of the list so it's clear for users the latest one that has been uploaded. I tried using the angular order by command but that doesn't seem to work unless it's an existing list compared to adding a new file to the list.
Basically I create a new row for each file once it's complete and print out the file details:
<tr ng-repeat="file in $flow.files | orderBy:'file.name'" ng-hide="file.isComplete()">
the list looks like this before upload:
old1
old2
old3
then I add a new file and I see:
old1
old2
old3
new1
when I'd like:
new1
old1
old2
old3
This is probably more of a question about using Angular's ng-repeat functionality for new items added to the list.
To use orderBy filter, you need just let the property in filter, as the following:
EDIT
Since you want to sort your items by chronological order, it should give you the expected result:
Here's is a snippet working: