Answer the question
In order to leave comments, you need to log in
What to do if the server gives a non-standard data array for Backbone?
I use a bunch of Kohana + Backbone
I make a request with a collection to the address: /kohana/v1/welcome.json
In response, I receive data of the format:
{
"action": {
"restexample": [
{
"name": "Kirill",
"age": 25,
"job": "web-developer"
},
{
"name": "Andrey",
"age": 12,
"job": "web-developer"
},
{
"name": "Семен",
"age": 43,
"job": "web-developer"
},
{
"name": "Куршавеёйль",
"age": 23,
"job": "web-developer"
}
]
}
}
Answer the question
In order to leave comments, you need to log in
To do this, you need to override the parse method in the collection .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question