Created
March 24, 2013 02:13
-
-
Save machty/5230161 to your computer and use it in GitHub Desktop.
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
App.Router.map -> | |
@route "a" | |
@route "b" | |
@route "ab" | |
@route "ba" | |
App.ARoute = Em.Route.extend | |
transitions: | |
'to b': (e) -> | |
e.transitionTo 'ab' | |
App.BRoute = Em.Route.extend | |
transitions: | |
'to a': (e) -> | |
e.transitionTo 'ba' | |
App.AbRoute = Em.Route.extend | |
isInaccessibleByURL: true | |
setup: -> | |
console.log('doin crazy animations') | |
# ... eventually, asyncly: | |
this.transitionTo 'b' | |
App.BaRoute = Em.Route.extend | |
isInaccessibleByURL: true | |
setup: -> | |
console.log('doin crazy animations') | |
# ... eventually, asyncly: | |
this.transitionTo 'a' | |
# Would be very pretty easy to write your own to write all the boilerplate | |
# and define the intermediate URL-less route. Something like: | |
defineAnimation 'a', 'b', -> | |
# This gets injected into setup of generated intermediate route | |
console.log('doin crazy animations') | |
this.transitionTo 'a' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment