Мне нужно вызвать метод initialize
родительского класса изнутри наследуемого MyModel
-класса, а не полностью переписать его, как я делаю сегодня.
Как я могу это сделать?
Здесь мой код выглядит прямо сейчас:
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.
},
});