Skip to content

Instantly share code, notes, and snippets.

@shanecp
Created March 28, 2014 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanecp/9825911 to your computer and use it in GitHub Desktop.
Save shanecp/9825911 to your computer and use it in GitHub Desktop.
BB: Backbone Pass options to the view
// Compatibility override - Backbone 1.1 got rid of the 'options' binding
// automatically to views in the constructor - we need to keep that.
// http://stackoverflow.com/questions/19325323/backbone-1-1-0-views-reading-options
Backbone.View = (function(View) {
return View.extend({
constructor: function(options) {
this.options = options || {};
View.apply(this, arguments);
}
});
})(Backbone.View);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment