ng-sortable with bi-directional array

Asked

Viewed 18 times

0

need to traverse a array of array and create separate lists using ng-sortable pro user can change data positions.

Array()

$scope.teste = [{'julio' : 16, 'emerson' : 14, 'aspas' : 13},
                {'fernando' : 22, 'robson' : 25, 'semedo' : 24, 'kaio' : 27},
                {'luiz' : 37, 'armando' : 41, 'aroldo' : 51}];

my html:

<ul class="list-group" 
    ui-sortable="sortableOptions"
    ng-repeat="(key, data) in teste track by $index"
    ng-model="key" class="list">

    <li ng-repeat="(k, d) in data track by $index"
        ng-model="k"
        class="ui-state-default">
            {{k}} : {{d}}
    </li>
</ul>

{{teste}}

mine sortableOptions

$scope.sortableOptions = { connectWith: '.connectedItemsExample .list' };

Error:

Error: ngModel.$modelValue.splice is not a function wireUp/callbacks.stop

with a list just using array works normal, but go through array of array and for each array create a list, this code does not serve.

  • what is the value of your sortableOptions ?

  • it seems that the problem is in using, array with indices

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.