Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created November 15, 2011 21:45
Show Gist options
  • Save dagda1/1368467 to your computer and use it in GitHub Desktop.
Save dagda1/1368467 to your computer and use it in GitHub Desktop.
remove.coffee
unbindFromAll: ->
_.each(@bindings, (binding) ->
binding.model.unbind(binding.ev, binding.callback)
)
@bindings = []
dispose: () ->
@disposeViews()
@unbindFromAll()
@unbind()
@remove()
disposeViews: ->
if @views
_(@views).each (view) ->
view.dispose()
@views = []
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment