use*_*719 6 ember.js strongloop loopbackjs
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"
}]
}
Run Code Online (Sandbox Code Playgroud)
是否有可能从strongloop返回这种JSON格式?
默认情况下,开箱即用的 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"
}
]
}
Run Code Online (Sandbox Code Playgroud)
但是您可以用来remote methods执行相同的工作,然后将数据调整为您希望返回的方式。http://docs.strongloop.com/display/public/LB/Remote+methods