Ember Data的REST适配器以这种格式接受来自服务器的JSON:
取自文档:http://guides.emberjs.com/v1.10.0/models/the-rest-adapter/
{
"post": {
"id": 1,
"title": "Node is not omakase",
"comments": [1, 2, 3]
},
"comments": [{
"id": 1,
"body": "But is it _lightweight_ omakase?"
},
{
"id": 2,
"body": "I for one welcome our new omakase overlords"
},
{
"id": 3,
"body": "Put me on the fast track to a delicious dinner"
}]
}
是否可以从strongloop返回这种JSON格式?
答案 0 :(得分:0)
默认情况下,开箱即用的restful api端点会返回看起来更像的内容:
{
"id": 1,
"title": "Node is not omakase",
"comments": [
{
"id": 1,
"body": "But is it _lightweight_ omakase?"
},
{
"id": 2,
"body": "I for one welcome our new omakase overlords"
},
{
"id": 3,
"body": "Put me on the fast track to a delicious dinner"
}
]
}
但您可以使用remote methods
执行相同的工作,然后按照您希望的方式按下数据。 http://docs.strongloop.com/display/public/LB/Remote+methods