Joined August 2014
·
Posted to
A Better way of extending Backbone Models and Views
over 1 year
ago
I think that the line:
extended._super = this.prototype;
should be
extended.prototype._super = this.prototype;
Posted to
A Better way of extending Backbone Models and Views
over 1 year
ago
The ferrari engine() method doesn't seem to work am I using this wrong?
test = new Ferrari()
child {cid: "c4", attributes: Object, _changing: false, _previousAttributes: Object, changed: Object…}
test.engine()
TypeError: Cannot read property 'engine' of undefined
no problem, thanks for the code. I am curious, when you create an instance of an extending class how do you make the super class initialize function fire?
Right now I just write this._super.initialize.call(this,args) in the extending classes initialize, but it would be nice if this happened implicitly.