3 ms·
I only reviewed it quickly, but I think they should be using the "then" pattern of promises when saving and transitioning. So this: this.get('model').save();
by Mc_Big_G 13y ago
I only reviewed it quickly, but I think they should be using the "then" pattern of promises when saving and transitioning.
So this:
this.get('model').save();
this.transitionToRoute('users');
Should be:
var controller = this;
this.get('model').save().then(function(model) {
controller.transitionToRoute('users');
}).fail(function(error) {
//Feedback for the user
});
- ulisesrmzroche 13y agoTrue. That's how you should implement the flow control after validation.