Skip to content

Instantly share code, notes, and snippets.

@machty
Created March 24, 2013 02:13
Show Gist options
  • Save machty/5230161 to your computer and use it in GitHub Desktop.
Save machty/5230161 to your computer and use it in GitHub Desktop.
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