You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is there more clean way to implement transitionAfterSave? #29
in ember_data_example github source code. It use this approach
transitionAfterSave: function() {
// when creating new records, it's necessary to wait for the record to be assigned
// an id before we can transition to its route (which depends on its id)
if (this.get('content.id')) {
this.transitionToRoute('contact', this.get('content'));
}
}.observes('content.id'),
It works fine, but maybe, this function will be executed whenever model's ID property is changed. I'm finding some more semantic way.
I want transition to be executed when the model's status is changed to 'isDirty' = false && 'isNew' == true form 'isDirty' = true, 'isNew' = false.
It would be much preferable to monitor didCreate. However, the observer is an unfortunate hack around warp-drive-data/warp-drive#405
The observer is only used to transition away after created records have been materialized. There's no danger of ids being changed (except from null -> server_assigned_id) in this application.
I'll leave this issue open until we can remove this hack.
Activity
dgeb commentedon Feb 20, 2013
It would be much preferable to monitor
didCreate. However, the observer is an unfortunate hack around warp-drive-data/warp-drive#405The observer is only used to transition away after created records have been materialized. There's no danger of ids being changed (except from null -> server_assigned_id) in this application.
I'll leave this issue open until we can remove this hack.
tchak commentedon Feb 22, 2013
[edit] Nether mind, I though it was an ember issue
github needs to be more clear in marking cross-project issue links...
ZenCocoon commentedon May 15, 2013
As warp-drive-data/warp-drive#405 is now resolved, I think this could be updated and closed as well.
sly7-7 commentedon May 15, 2013
@ZenCocoon you're right, we should now be able to put a listener on the didCreate event.
lulezi commentedon May 15, 2013
It looks like there are still issues: warp-drive-data/warp-drive#405 (comment)