Answer the question
In order to leave comments, you need to log in
How to combine objects with RESTful API using Angular?
Hello!
Now I will try to explain the situation:
There is a REST Api that returns all objects (Python Flask) in this form:
"/catalogues/<_id>" - returns objects from the catalog by id
"/catalogues/" - returns all objects from the catalog by id
" /items/<_id>" - returns all objects that are in the directory
"/items/" - returns objects that are in the directory by id
So here is an example of a response from /catalogues/<_id>:
{catalog_image: 4, catalog_name: 1, id: 1, items: 1, object_name: "M31"} ,
{catalog_image: 3, catalog_name: 1, id: 2, items: 2, object_name: "M45"}
{name: "My Item", id: 1"}
{catalog_image: 3, catalog_name: 1, id: 2, items: My Item, object_name: "M45"}
?? Answer the question
In order to leave comments, you need to log in
angular has nothing to do with it. You have to sort this out yourself. You can also look at libraries for working with the rest api (restangular, ngResource, js-data or any other popular one).
Well it is more like Yes. Resources are resources. They have nothing to do with the base. But if for some reason you need to link resources together, then this is not a problem. Your apish, if you have control over it, should be easy to use in the first place, restfull pens can be left if it is not of practical use.
ps if you don't understand - I suggest you read the examples from jsonapi.org
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question