Ok, I think I've got this squared away...posting here in case it might help someone else.
Sander's recommendation to wrap the call to my controllers changeCategory() method in a "scope.$apply()" definitely needed to be done. However, even though I could see that my controller's method was being successfully called, the UI wasn't updating correctly: I'd drag a task from one category to a new category, but that task wouldn't show up in the new category (or disappear from the old category).
I think this was because in my controller's method, I was trying to find the task I was dropping (based on its ID) by using a filter:
var task = $filter('filter')($scope.tasks, {id: task_id}, true);
I remember reading that any time you use a filter on an array, a new copy is made of that array containing the filtered data. I think by doing this, the task I was finding (and updating) belonged to a different (new) array than was being used for my bound task list. So, instead of using a filter to find my task, I did it the old fashioned way, using a loop:
for(var i=0; i<$scope.tasks.length; i++) {
var task = $scope.tasks[i];
task.category_id = category_id;
}
}
This seems to be working perfectly! It seems like there should be a more elegant way of doing this but it is behaving as expected. Here's a new
bin showing the result.
If anyone has any ideas regarding a cleaner way of accomplishing this, I'd be curious to hear about it. This gives me enough to work with, though.
Thanks!