vendredi 2 octobre 2015

Ember :POST http://localhost:9000/ 404 (Not Found) while returning model

I am retuning model using .getJSON as below,

Taskmanagementfortenmiles.TaskRoute = Ember.Route.extend({
    model: function() {
        //return Ember.$.getJSON("http://localhost:3000/tasks");
      var self = this;
      return Ember.$.getJSON("http://localhost:3000/tasks").then(function(response) {
                  var taskArr = [];
                  response.forEach(function(task) {
                  taskArr.push(task);
                  console.log(self.store.createRecord('task', {
                        id :task.id,
                        display_id: task.display_id,
                        type: task.type,
                        display_name: task.display_name,
                        isCompleted: task.isCompleted,
                        timestamp: task.timestamp
                    }).save());
                    //this.transitionToRoute('task');
                    //Taskmanagementfortenmiles.Task.createRecord();
                }); 

                return taskArr;
        });
    },

});

I am getting the following error.

enter image description here

  1. Did I have to make a transitionRoute to my 'task' hbs file?

Please give any suggestion me to solve this issue?

thanks in advance:-)




Aucun commentaire:

Enregistrer un commentaire