Skip to content

Instantly share code, notes, and snippets.

@srsgores
Created November 19, 2014 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srsgores/19a55df1398be0d1c896 to your computer and use it in GitHub Desktop.
Save srsgores/19a55df1398be0d1c896 to your computer and use it in GitHub Desktop.
Authenticated route for a dashboard in EmberJS
`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