Ionic Framework: reorder order error - Missed TypeError: cannot getValues ​​null property

I am making an improved version of the Todo application from a tutorial, and I get an error when trying to reorder items from a list.

I think that everything is in order, but when I try to reorder the elements, Ionic gives this error, and the reordering does not work:

Uncaught TypeError: Unable to read the getValues ​​property from nullReorderDrag.moveElement @ ionic.bundle.js: 7429ReorderDrag.start @ ionic.bundle.js: 7458ionic.views.ListView.ionic.views.View.inherit.startDrag @ ionic.bundle. js: 7744ionic.views.ListView.ionic.views.View.inherit._handleDrag @ ionic.bundle.js: 7804 (anonymous function) @ ionic.bundle.js: 7610triggerEvent @ ionic.bundle.js: 811dragGesture @ ionic.bundle. js: 1858detect @ ionic.bundle.js: 1389bindDomOnTouch @ ionic.bundle.js: 938

I am testing it with Chrome on Mac OS X Yosemite using ion feed. It does not work on Android or iOS.

I created Codepen with the app: http://codepen.io/anon/pen/EjjqPE

Here is part of the list of ions:

<ion-list show-delete="showDeleteTasks" show-reorder="true">
<ion-item class="item-remove-animate" ng-repeat="task in activeProject.tasks" item="task">
{{task.title}}
<ion-delete-button class="ion-minus-circled" ng-click="deleteTask($index)">
</ion-delete-button>
<ion-reorder-button class="ion-navicon" on-reorder="reorderTask(task, $fromIndex, $toIndex)">
</ion-reorder-button>
</ion-item>
</ion-list>

And here is the reorderTask method from the JS file (it is called, but always with the same fromIndex and toIndex, so it does nothing):

$scope.reorderTask = function(task, fromIndex, toIndex) {
console.log("reorderTask llamado");
console.log("Task: " + task);
console.log("fromIndex: " + fromIndex + " - toIndex: " + toIndex);
$scope.activeProject.tasks.splice(fromIndex, 1);
console.log("reorderTask 1");
$scope.activeProject.tasks.splice(toIndex, 0, task);
console.log("reorderTask 2");
Projects.save($scope.projects);
console.log("reorderTask 3");
}

- ? ?

!

+4
1

, <ion-content scroll="false"> true, .:)

.

+3

All Articles