Angular Restangular on sortable, how to save?

49 Views Asked by At

I need to change the order of scope, save but me back an error that save() is not a function.

I'm using restangular to create the objects.

The function is triggered Onsort, I tried using http, but also gives me error.

$scope.onChange = function() {
        ApiRestangular.all($scope.section).getList($scope.query).then(function(res){
            $scope.items = res;

            order = ApiRestangular.copy(res);

            console.log(order);

            $scope.sortOptions = {
                animation   : 150,
                onSort: function(){
                    order.put().then(function(){
                        toast.msgToast($scope.section+ ' ...Ordem atualizada!');
                    });
                }
            };
        });
    };
0

There are 0 best solutions below