Last active
December 15, 2015 21:50
-
-
Save machty/5328816 to your computer and use it in GitHub Desktop.
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
| # Default ApplicationRoute | |
| App.ApplicationRoute = Em.Route.extend | |
| events: | |
| routeTo: (routeName, objects...) -> | |
| @router.transitionTo.apply @router, arguments | |
| # {{linkTo}} will call routeTo | |
| # URL changes (handleURL) will determine target route name, | |
| # then call routeTo, so it's handleable. | |
| # separate ember-transitions library: | |
| # overrides App.ApplicationRoute | |
| App.ApplicationRoute.events.routeTo = -> | |
| Ember.Transitions.handleTransition.apply arguments | |
| # ember-transitions will inject/handle the DSL for | |
| # transitions that is suggested in my gist, e.g.: | |
| App.AdminRoute = Em.Route.extend | |
| transitions: | |
| 'from *': (e) -> | |
| e.preventTransition() if notLoggedIn() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment