rest - AngularJS $resource DELETE item in collection -
I have an ASP.NET Web API (1) controller which works with GET, POST and DELETE functions. I'm calling with an angular 1.2.0 RC3 app with $ resource
. Let's call the controller Foos
.
I get a GET that lists the fuo:
GET http: // localhost: 55386 / API / FOS / 123456/1 http / 1.1 host : Localhost: 55386 Connection: Keep Accepted Alive: Application / Jason, Text / Plain, * / * Native: Zero User-Agent: Mozilla / 5.0 (Windows NT 6.3; WOW64) Apple WebKat / 537.36 (like GHtml, GECO) Chrome / 38.0.2125.111 Safari / 537.36 Approved-encoding: accept jip, deflate, SDC-Language: N-US, N; Q = 0.8, es; Q = 0.6
Where is the resource
/ api / foos / clientId / recordId
here I am saying Get me a list of FOE for Cloud X and Record Y
Now, I want to remove a single foo from the list of that fuse, so I $ Delete
:
$ scope.delete = function (foo) {foo. $ Delete} (); }
Although the following result is the result:
delete http: // localhost: 55386 / api / foos / 123456/1 http / 1.1 host : Public Host: 55386 Connection: Keep Accepted Alive: Application / Jason, Text / Plain, * / * Native: Zero User-Agent: Mozilla / 5.0 (Windows NT 6.3; WOW64) Apple WebKat / 537.36 (like KHML, GECO) Chrome / 38.0.2125.111 Safari / 537.36 Approved-encoding: gzip, deflate, sdch Accepted-language: N-US, N; Q = 0.8, es; Q = 0.6
This is clearly trying to delete
My question is, how do I get every foo in my gate request Remove a single FU without using a mascot $ resource?
update:
I can do GET / api / foo / 1
where resource foo / fooId
, And its equivalent DELETE / api / foo / 1
to delete it, but I personally want to get a list of FUO instead of Foo.
I know that the te hat is not a question, but you should be drifted. It's easy to chat with the rest of the services
Comments
Post a Comment