1
我有$ scope.todos Node.js的服务器,并在我的控制器代码提交即
$scope.submitChanges = function() {
var todos = $resource("/todo");
//code goes here for sending variable
}
我想将它发送到节点。 JS,这需要它:
router.post("/",function(req, res) {
var collection = db.get("todo");
collection.insert({ /* here comes the data to insert */ }, function(err, todos) {
if(err) throw err;
res.json(todos);
})
})
我们不能做到这一点使用$资源,而不是使用$ HTTP。谢谢.. – SaiUnique
是的,你必须这样做使用$资源 –
检查更新的答案 –