111
rated 0 times
[
115]
[
4]
/ answers: 1 / hits: 39337
/ 13 Years ago, mon, january 23, 2012, 12:00:00
I need to call the initialize
method of the parent class, from inside the inherited MyModel
-class, instead of completely overwriting it as I am doing today.
How could I do this?
Here's what my code looks right now:
BaseModel = Backbone.Model.extend({
initialize: function(attributes, options) {
// Do parent stuff stuff
}
});
MyModel = BaseModel.extend({
initialize: function() {
// Invoke BaseModel.initialize();
// Continue doing specific stuff for this child-class.
},
});
More From » oop