这是 JSON 的示例
{
"users": [
{
"id": "10",
"email": "test8@test.org",
"activated": true,
"created_at": "2013-08-25 19:30:16",
"username": "Roober"
}
]
}
这有效:
App.User = DS.Model.extend({
username: DS.attr(),
email: DS.attr(),
activated: DS.attr(),
created_at: DS.attr()
});
这不会:
App.User = DS.Model.extend({
username: DS.attr(),
email: DS.attr(),
activated: DS.attr(),
createdAt: DS.attr()
});
createdAt 返回未定义。
Ember 是 v1.0.0,Ember Data 是 v1.0.0-beta.2