Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Spine.js Controller in Pragmatic.ly
class App.LeftIterationController extends Spine.Controller
el: '.sidebar #iterations'
elements:
'ul.list': 'list'
constructor: ->
super
App.Iteration.bind 'create', @addIteration
App.Iteration.bind 'refresh', @refreshIterations
release: ->
super
App.Iteration.unbind 'create', @addIteration
App.Iteration.unbind 'refresh', @refreshIterations
addIteration: (iteration) =>
iteration.unbind()
view = new App.IterationItem(item: iteration)
@list.append(view.render().el)
refreshIterations: (iterations) =>
@addIteration iteration for iteration in iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.