Skip to content

Instantly share code, notes, and snippets.

@superchris
Created May 14, 2011 21:09
Show Gist options
  • Select an option

  • Save superchris/972638 to your computer and use it in GitHub Desktop.

Select an option

Save superchris/972638 to your computer and use it in GitHub Desktop.
A FooView that creates his BarView during render and reuses it
class FooView extends Backbone.View
"#button click": "displayBarView"
render: ->
# Do the normal rendering
@barView = new BarView(el: @$("#bar_view"))
displayBarView: ->
@barView.display()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment