我有一个 REST 端点"http://localhost:8080/customers"
,我想将它连接到我的 Ember JS 应用程序。
App.Store = DS.Store.extend({
revision: 12,
adapter: DS.RESTAdapter.extend({
url: 'http://localhost:8080/customers'
})
});
REST 负载
{
"_links" : {
"search" : {
"href" : "http://localhost:8080/customers/search"
}
},
"_embedded" : {
"customers" : [ {
"id" : 2,
"firstName" : "Jim",
"lastName" : "Smith",
"_links" : {
"self" : {
"href" : "http://localhost:8080/customers/2"
}
}
}, {
"id" : 1,
"firstName" : "Jimmy",
"lastName" : "Jones",
"_links" : {
"self" : {
"href" : "http://localhost:8080/customers/1"
}
}
} ]
}
}
我不断收到此错误。这是我在 Ember JS 上的第二周。老实说,这比我想象的要难得多。不太容易调试或理解。
加载路线时出错:
TypeError: undefined is not a function
at App.CustomersRoute.Ember.Route.extend.model