Error: (intermediate value)(...) is not a function

1.1k Views Asked by At

Im getting this error trying to delete a subdocument of my model.

Error: (intermediate value)(...) is not a function
resourceFactory/</Resource[name]/promise<@http://localhost:3000/lib/angular-resource/angular-resource.js:627:18
processQueue@http://localhost:3000/lib/angular/angular.js:13318:27
scheduleProcessQueue/<@http://localhost:3000/lib/angular/angular.js:13334:27
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:3000/lib/angular/angular.js:14570:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:3000/lib/angular/angular.js:14386:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:3000/lib/angular/angular.js:14675:13
done@http://localhost:3000/lib/angular/angular.js:9725:36
completeRequest@http://localhost:3000/lib/angular/angular.js:9915:7
requestLoaded@http://localhost:3000/lib/angular/angular.js:9856:9 

And here is my function:

function remove_rol(_id2,idRol) {       //_id2 = 888888888 & idRol: 1, both exist on my model
    vm.area.$update( { "_id": _id2 },{ "$pull": {"roles":{"id_rol":idRol}}});
    $state.go('roles.list', {});
  }

Already read the documentation about $pull and it looks like im doing well, any help?

0

There are 0 best solutions below