Created
December 19, 2014 12:33
-
-
Save xcambar/69b5b23f8156de5b08d2 to your computer and use it in GitHub Desktop.
Ember simple redirect to error
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
App.AuthenticatedRoute = Ember.Mixin.create({ | |
beforeModel: function () { | |
var isUserConnected = false; | |
if (!isUserConnected) { | |
throw new Error('Fail'); | |
} | |
} | |
}); | |
App.IndexRoute = Ember.Route.extend(App.AuthenticatedRoute, { | |
beforeModel: function() { | |
this._super(); // Don't forget that, or your mixins won't be called | |
this.transitionTo("documents"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment