Restangularize subresources
See original GitHub issueIs there a simple way to tell restangular that a certain field is a collection of resources?
For instance in my app I can do:
GET to: /api/courses/123
Restangular.one('courses', 123).get();
/* OR */
GET to: /api/courses/123/students
Restangular.one('courses', 123).all('students').getList();
The first call however, fetches the course with a field students
that already contains an array of the students in the course. Is there any way to say: “Restangular, this array is not merely an array of objects, but rather it’s a student collection” so that then I can do things like students[0].remove()
Unrelated: Vamos a ganar el mundial o no?
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Defining sub-resources for your RESTful API - Medium
Article 10 in the series of “ Pragmatic decisions for your RESTful API”, this post talks about defining sub-resources in your RESTful API....
Read more >RESTful design: when to use sub-resources? - Stack Overflow
Assign all resources a canonical URI at the root (e.g. /companies/{id} and /employees/{id} ). If a resource cannot exist without another, it should...
Read more >REST API Design Best Practices for Sub and Nested Resources
One topic in this space that is debated quite often is the nesting of resources also called sub-resources. Why would anyone nest their...
Read more >REST Web Services 25 - Implementing Subresources - YouTube
Website: http://javabrains.koushik.org/courses/javaee_jaxrs/lessons/Implementing-SubresourcesWe'll now implement nested resources using the ...
Read more >REST API - Handling subresources
Would it be incorrect to consider profile,address,contacts as subresources. No, anything you like can be a subresource. REST doesn't care (a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What about:
Can a more concrete example be provided for this?