Created
November 19, 2014 00:25
-
-
Save srsgores/19a55df1398be0d1c896 to your computer and use it in GitHub Desktop.
Authenticated route for a dashboard in EmberJS
This file contains 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
`import Ember from "ember"` | |
DashboardRoute = Ember.Route.extend( | |
beforeModel: (transition) -> | |
loginController = @controllerFor("login") | |
unless loginController.get("isLoggedIn") | |
loginController.setProperties({ | |
loginFailed: true | |
attemptedTransition: transition | |
}) | |
@transitionTo("login") | |
) | |
`export default DashboardRoute` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment