The last one, Controller, is an action that you can carry out on a resource that would require logic beyond the simple CRUD-based operations provided by the vanilla HTTP verbs. For example, if I had a "messages" resource, I might have two controllers for:
The (bolded) controllers act upon their related resource. So anyway, long store short, I was having a lot of trouble figuring out how to define the AngularJS resource to account for this. I didn't see this in the documentation, but it turns out that you can define multiple parameter bindings in a single part of the URL template. As such, I can define, in item two of the URL template, TWO different bindings:
Notice that the second item is basically saying "listController OR id". Now, as long as I only use one of the "versions" at a time, AngularJS can manage the resource URL properly.
This had me stumped for a good while. Hope this helps someone else.
For more info, here's my write-up: http://www.bennadel.com/blog/2433-Using-RESTful-Controllers-In-An-AngularJS-Resource.htm
Cheers,
Ben Nadel
Nice!
... sent from my tablet
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.