vendredi 16 octobre 2015

how pass value to my model using setupController and model function ember

I have a model 'date' that i want to initialize. In the route file I have the following code:

model: function(){
    var newModel = this.store.createRecord("date",{index: 1, start_date:"", finish_date: ""});
    console.log("im going to return "+ newModel);
    return newModel;
  },

  setupController: function(controller, model){
    controller.set('date', model);
    console.log("im in setup and model has "+ model);
  }

The console log said that my object is null, Why?

can anyone help me? thanks




Aucun commentaire:

Enregistrer un commentaire