I am trying to delete an object from an array with Angularjs Resource:
CommandeDetail.delete({id:commandeDetail.id});
My factory :
.factory('CommandeDetail', function ($resource) {
return $resource('api/commandeDetail/:id', {}, {
'query': { method: 'GET', isArray: true},
'get': {
method: 'GET'
}
});
})
My object commandeDetail is (debug on Chrome before delete is called) :
commandeDetail: Resource
$$hashKey: "object:1136"
calibre: "douze"
categorie: "II"
certificatFournisseur: "AGROCERT"
commande: null
commandeId: 10
commentaire: null
dispJ4: 0
emballage: "COLIS 10 KG NET"
id: 35
marque: "ECOCERT"
max: 10
nbPalettes: 0
produit: "ABRICOT"
puht: 0
quantite: 10
tare: 0
valorisation: "Net"
The delete is well done on server side but I am getting this error on frontSide :
angular.js:11598 RangeError: Maximum call stack size exceeded
at join (native)
at Object.stringify (native)
at toJson (http://localhost:8080/bower_components/angular/angular.js:1048:15)
at defaults.defaults.transformRequest (http://localhost:8080/bower_components/angular/angular.js:8707:74)
at http://localhost:8080/bower_components/angular/angular.js:8655:12
at forEach (http://localhost:8080/bower_components/angular/angular.js:323:20)
at transformData (http://localhost:8080/bower_components/angular/angular.js:8654:3)
at $get.serverRequest (http://localhost:8080/bower_components/angular/angular.js:9319:23)
at processQueue (http://localhost:8080/bower_components/angular/angular.js:13175:27)
at http://localhost:8080/bower_components/angular/angular.js:13191:27
I don't know where that can come from. My object is quite simple.
If anybody can help me on this...
Thanks