Skip to content

Instantly share code, notes, and snippets.

@gwokae
Created September 21, 2012 07:52
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 gwokae/3760251 to your computer and use it in GitHub Desktop.
Save gwokae/3760251 to your computer and use it in GitHub Desktop.
backbone extend problem
var superView = Backbone.View.extend({
initialize: function(){
if(this.val2) this.op.c = this.val2;
console.log(this.op);
},
op: {a:"B"},
m1: function(){},
m2: function(){},
events1: {
"click div":"m1"
}
});
var childView = superView.extend({
val2: "YA",
extendEvents: {
"click span":"m2"
}
});
new superView();
new childView();
new superView();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment