jeudi 14 janvier 2016

EMBER: How to call a new Save action inside Save action

I have an simple app that save's a single transaction, my first model has relationship to the second model, since I'm having some trouble to get the relationship/child data of my first model, I decided to call a new save function inside the save action. Is it possible in Ember ? how should I implement this? Sample code in routes/sales-order.js

actions:{
save:function(){
    var currentModel = this.modelFor('sales-order');
//currentModel has property salesOrderDetails which is maybe an array of object
//i want to check if salesOrderDatils isDirty, if dirty then call another save function for this//
else
    currentModel.save();

  }

},




Aucun commentaire:

Enregistrer un commentaire