Accessing parent class in Backbone

后端 未结 8 844
广开言路
广开言路 2020-12-07 14:40

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 doi

8条回答
  •  囚心锁ツ
    2020-12-07 15:14

    MyModel = BaseModel.extend({
        initialize: function() {
            MyModel.__super__.initialize.apply(this, arguments);
            // Continue doing specific stuff for this child-class.
        },
    });
    

提交回复
热议问题