1
내가 콘솔에 따라, JSON을 얻고있다하지만이 오류가 계속에서보기에로드하기 아니에요 는 JSON 데이터를 얻기 있지만, Ember.js
Assertion failed: Your server returned a hash with the key 0 but you have no mapping for it
이 오류
,TypeError {} "Cannot call method 'toString' of undefined"
가 여기에 샘플 JSON 응답이다,
[{"id":"1","last_name":"Solow","first_name":"Jeanne","suffix":null,"expiration":"2013-11-15","email":"[email protected]","street":"16 Ludden Dr.","city":"Austin","state":"TX","zip":"33347","phone":"964-665-8735","interests":"Great Depression,Spanish-American War,Westward movement,Civil Rights,Sports"}, {etc..}
은 여기 내 app.js,이다
App = Ember.Application.create({});
App.Store = DS.Store.extend({
revision : 12,
adapter : DS.RESTAdapter.extend({
url : 'http://ankur1.local/index.php/api/example/users/format/json',
dataType : 'jsonp',
})
});
App.IndexRoute = Ember.Route.extend({
renderTemplate : function() {
this.render('myTemplate', {
controller : 'Index'
});
},
model : function() {
return App.myTemplate.find();
}
});
App.IndexController = Ember.Controller.extend({
user : Ember.Object.create({
name : ""
}),
userNameBinding : Ember.Binding.oneWay("this.user.name"),
clickButton : function(name) {
if ($("#name").val().trim().length === 0) {
alert("text box is empty");
} else {
}
}
});
App.myTemplate = DS.Model.extend({
id : DS.attr('int'),
last_name : DS.attr('string'),
first_name : DS.attr('string'),
suffix : DS.attr('string'),
expiration : DS.attr('date')
});
필자는 Phil Sturgeon의 Codeigniter RestServer Library를 백엔드에서 사용하고 있습니다. 내 코드에 어떤 문제가 있거나 백엔드에서 문제가 될 수 있습니까?