How to make ng-repeat work with the end of the array, preserving its order?

There is a specific case when you need to ng-repeat worked from the end, not the beginning.
Ie, say there is an array of elements (e.g. references to images) ['url1', 'url2, 'url3'....]
By default
<img ng-repeat="img in images track by $index" ng-src="{{img}}">
add DOM for each img in order starting from url1, using something similar to insertAfter(); is it Possible to make it work in the opposite direction, so he added first, url3, url2 then url3 BEFORE and ie kept the order, but worked as insertBefore();
images.slice().reverse() in this case does not work, because changing the order in the array on the back, and I just need to change the order of the renderer. I hope the question is clear.
July 8th 19 at 11:54
2 answers
July 8th 19 at 11:56
There is a specific case when you need to ng-repeat worked from the end, not the beginning.


Do revert in the controller array. Do not decide such at the template level. Well either write a filter.
July 8th 19 at 11:58
correctly advised, but if lazy, you can isralites
<img ng-repeat="img in images track by $index" ng-src="{{images[images.length - $index -1]}}">

Find more questions by tags AngularJavaScript