You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
I added orderBy to Connected sortables demo, then drag the last item from the left to right, it will move the second last item to the right, not the last item that I wanted to move.
<div class="app" ng-repeat="app in rawScreens[0] | orderBy: 'title'">{{$index}} {{app.title}}</div>
This issue again... Duplicate of #70, #113, #122, #172, ...
The reason is that your ng-model is different than the array used by the ng-repeat (fair enough, since you are ordering just the ng-repeat).
README states:
Filters that manipulate the model (like filter, orderBy, limitTo,...) should be applied in the controller instead of the ng-repeat (refer to the provided examples).
This is the preferred way since it:
is performance wise better
reduces the chance of code duplication
is suggested by the angularJS team
it does not break the matching of the generated DOM elements and the ng-model's items
Have you checked the two ordering examples (also found in README)?
As I have asked earlier in this repo:
how people expect the original (non filtered/ordered) model to be updated, after sorting a modified/sorted sub-model of that??? I really can't find an example.
I added orderBy to Connected sortables demo, then drag the last item from the left to right, it will move the second last item to the right, not the last item that I wanted to move.
<div class="app" ng-repeat="app in rawScreens[0] | orderBy: 'title'">{{$index}} {{app.title}}</div>
Here the demo
The text was updated successfully, but these errors were encountered: