Service $resource('/user/:userId') If I want to post a new user, how should the service be written? Or is it that the URL cannot be like this? Doesn't it seem possible to use save({},{name:'a'}) directly?
I didn’t know much about it when I first came into contact with it before服务封装return $resource('/api/user/u/:id',{id:'@id'},{update:{method:'PUT'},insert :{method : 'POST'}});
The front end calls userService.insert({},{data:...},function(data){
//callback
})
I didn’t know much about it when I first came into contact with it before
服务
封装return $resource('/api/user/u/:id',{id:'@id'},{update:{method:'PUT'},insert :{method : 'POST'}});
The front end calls
userService.insert({},{data:...},function(data){ //callback })