Created
September 21, 2012 07:52
-
-
Save gwokae/3760251 to your computer and use it in GitHub Desktop.
backbone extend problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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