K
K
kazhuravlev2014-06-10 12:33:31
backbone.js
kazhuravlev, 2014-06-10 12:33:31

How to work with nested models in Backbone?

How to work with server responses that contain a link to other data located at a different URL?
For example, the server response may be as follows (we get two objects that contain three links to child elements each. Data on child elements are located at the corresponding URLs):

[
    {
        "id": 1,
        "url": "/api/itemCollection/1/",
        "items": [
            "/api/item/1/",
            "/api/item/2/",
            "/api/item/3/"
        ]   
    },
    {
        "id": 2,
        "url": "/api/itemCollection/2/",
        "items": [
            "/api/item/1/",
            "/api/item/4/",
            "/api/item/5/"
        ]   
    }
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
green_turtle, 2014-06-10
@green_turtle

Similar to hypermedia. Look at this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question