I am using EmberJS with Ember Data (Revision 11) and am trying to transition to another route when a transaction has completed successfully. The problem is this page allows edits to the model as well as adding and removing items to a hasMany collection on that model.
What I currently have is as follows:
myModel.one "didUpdate", this, ->
@transitionTo "anotherRoute", myModel
myModel.transaction.commit()
Which will only ever transition if the myModel has been changed not if any of it's hasMany children have changed as well.
I am really looking for a way to either:
- Have the didUpdate event run when all the hasMany children for myModel have successfully saved
- Hook into a call back on the transaction when all models have be successfully persisted.