Skip to content

Instantly share code, notes, and snippets.

@unamashana
Last active January 1, 2016 07:19
Show Gist options
  • Save unamashana/8111163 to your computer and use it in GitHub Desktop.
Save unamashana/8111163 to your computer and use it in GitHub Desktop.
SB.Views.CurrentView = Backbone.View.extend(
SB.Views.CurrentView = Backbone.View.extend(
initialize: ->
_.bindAll this, "set", "render"
@setElement @options.el
set: (view, options) ->
@currentView = view
# By default, render() is a no-op in Backbone.View
@currentView.render()
$(@el).html @currentView.el
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment