我现在更新问题。
Mi view HTML
<a class="btn btn-success" ng-click="eliminartodo()">Eliminar todos</a>
现在我发送我的Controller Angular
.controller('ListCtrl', function($scope,$routeParams,Node,User) {
$scope.nodes = Node.query();
/**DeleteAll**/
$scope.eliminartodo = function () {
$scope.nodes = [];
};
})
和我的工厂
nodeServices.factory('Node', ['$resource',
function($resource){
return $resource('api/nodes/:nodeId', {}, {
'get': {method:'GET', params:{nodeId:'@nodeId'}, isArray:false},
'save': {method:'POST'},
'query': {method:'GET', isArray:true},
'update': {method:'PUT'},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'}
});
}]);
在另一个代码中,我使用它并正常工作
Node.remove({nodeId: nodeId}, $scope.node, function() {
$timeout(function() {
$location.path('/');
});
});