Accessing parent class in Backbone

后端 未结 8 870
广开言路
广开言路 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:21

    I think it'd be

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

提交回复
热议问题