当我尝试从路径返回模型时出现以下错误
我的模特task.js
//My Code for returning the model
//My Model initialization :
Taskmanagementfortenmiles.Task = DS.Model.extend({
display_id: DS.attr('string'),
type: DS.attr('string'),
display_name: DS.attr('string'),
isCompleted:DS.attr('boolean'),
timestamp: DS.attr()
});
My Route task_route.js:
Taskmanagementfortenmiles.TaskRoute = Ember.Route.extend({
model: function() {
return $.getJSON("http://localhost:3000/tasks").then(function(response) {
var task = [];
var self = this;
response.forEach(function(task) {
console.log(self.store.createRecord('task', {
display_id: random_id,
type: type,
display_name: displayName,
isCompleted: false,
timestamp: date
}).save());
});
return task;
});
},
});
我的ember数据版本是我收到错误的问题吗?
请有人在这个问题上帮助我。
提前致谢