我在尝试删除模型的子文档时遇到此错误。
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
这是我的功能:
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', {});
}
已经阅读了有关$pull的文档,看起来我做得很好,有什么帮助吗?