Last active
December 25, 2015 14:38
-
-
Save sipple/6992056 to your computer and use it in GitHub Desktop.
When I save the model for this controller, I'm trying to use the promise's resolution to transition back from the editUser route to the User route. All of the examples have some version of this.transitionTo (if the action is in the route) or this.transitionToRoute (if in the controller), but no matter where I place the action, the scope of "this…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Seanchai.EditUserController = Ember.ObjectController.extend({ | |
| actions: { | |
| cancel: function() { | |
| log.info("cancelling user edit"); | |
| this.transitionToRoute('user', this); | |
| }, | |
| save: function() { | |
| log.info("submitting user update..."); | |
| this.get("model").save().then(function(answer) { | |
| return this.transitionToRoute('user', answer); | |
| }); | |
| } | |
| } | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per Yehuda Katz (and thank you for the help, Yehuda!):
You need to save of
this(var route = this) and then use the saved off name inside