Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Spine Substack
class App.Root extends Spine.Stack
resources: App.Resources
users: App.Users
'/resources' : 'resources'
'/users' : 'users'
default: 'users'
className: 'stack root'
class App.Users extends Spine.SubStack
search : Search
show : Show
profile : Profile
'/users/search' : 'search'
'/users/search?q=:query' : 'search'
'/users/profile' : 'profile'
'/users/:id' : 'show'
default: 'search'
className: 'stack users'
class Spine.SubStack extends Spine.Stack
constructor: ->
for key,value of @routes
do (key,value) =>
@routes[key] = =>

This comment has been minimized.

Copy link

@MikeSilvis MikeSilvis commented May 31, 2012

what arguments go into here? @[value].active(arguments...)

And when do you ever call new SubStack to actually add the rendering to it.

My Gist:


This comment has been minimized.

Copy link
Owner Author

@nvh nvh commented May 31, 2012

If you pass a function, it will be bound the the activate trigger, so it will be called when the controller is activated, if you don't pass it anything, it will activate the controller.

You subclass the substack controller, and initialize it the same way you would with a stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment