javascript - How I can transform the result of node.js to prevent ember.js error: No model was found for '0 '? -


node.js returns (results):

[  {   "value1": "234",   "id": 67,   "value2": "76543"  },  {   "value1": "468",   "id": 68,   "value2": "98765"  },  {..} ] 

but ember.js needs

{ "data":[         {          "value1": "234",          "id": 67,          "value2": "76543"         },         {          "value1": "468",          "id": 68,          "value2": "98765"         },         {..}        ]  } 

and cannot find correct way modify node.js return function:

if err     console.log "error: #{err.message}"     throw err res.send results 

so think need "wrap" results of query... ideas?

oh, im using express if helps...

just use

res.send {data: results} 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -