I have a node. I am creating an angular application supported by the JS / Mongodb application.
I As told before, it is not supported by Where ID is generated by Mongodb for each resource when a resource is created.
POST After the new object on a server from a factory to the server, the response code with the location header set to the server of the new resource
id ? I can update the record with
angular.module ('myApp.Todoservices', ['ngResource']). Factory ('Todo', function ($ resource) {return $ resource ('http: // localhost \\: 3000 / todos /: id', {id: '@_ id'}, {getAll: {method: ' Update: {method: 'POST'}, delete: {method: 'DELETE'}})}};
$ resource , I know However, here's my work.
var tmpPart = New MyResource ({name: $ scope.item.name}); TmpPart. $ (Function (_tmpPart, feedback header) { $ Resource (feedback header ( "Space").) (Function (tempResourceObject) {$ scope.myResourceObjects.push (New MyResource (tempResourceObject)}}}}
New MyResource (tempResourceObject) is a new example of your resource object, you can do whatever you like with it.
No comments:
Post a Comment