Skip to content

Instantly share code, notes, and snippets.

@gorbach
Created November 29, 2012 19:24
Show Gist options
  • Save gorbach/4171247 to your computer and use it in GitHub Desktop.
Save gorbach/4171247 to your computer and use it in GitHub Desktop.
Bound Item View. Uses Backbone.Marionette and Model.Binder
BoundItemView extends Backbone.Marionette.ItemView
events: {}
initialize: ->
@events['click .btn-primary'] = 'save'
@modelBinder = new Backbone.ModelBinder()
super()
onRender: () ->
@modelBinder.bind @model, @el, @bindings
save: ->
@trigger 'save'
@close()
onClose: ->
@modelBinder.unbind()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment