E
E
Evgeny Elchev2014-11-06 16:40:55
Angular
Evgeny Elchev, 2014-11-06 16:40:55

How to change a property on an angular object based on the position of an item in a list?

Look, there is an array of objects in the controller, based on it I display a list using ng-repeat. The jquery sortable plugin is connected to the list and the elements in it can be mixed accordingly. So I would like to then change the order property of each object in the array so that it corresponds to the position of the element in the list. How can this be checked?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Benkovsky, 2014-11-06
@benbor

For starters, the architecture of jquery and angular is very different, and angular is good because it gets rid of jquery. (only jqlite selectors is all we need in angular application)
So - my advice to you, don't use jqury sortable - use..... google Found this
in 5 minutes , Seems there is a demo, examples too. There is an orderChanged callback there and change the value. I'm sure you can spend a little more time on google and find the optimal turnkey solution for your case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question