Skip to content

Instantly share code, notes, and snippets.

@djadriano
Created April 26, 2012 22:55
Show Gist options
  • Save djadriano/2503940 to your computer and use it in GitHub Desktop.
Save djadriano/2503940 to your computer and use it in GitHub Desktop.
Backbone.js mixins
var myMixin = {
foo : 'bar',
method_x : function() {
return true;
}
};
myView = Backbone.View.extend({
initialize : function() {
// add mixin in your View
_.extend( this, myMixin );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment