var Backbone = require('backbone');
var InheritedMixin = require('backbone.inherited');
Model1 = Backbone.Model.extend(_.extend({
someMethod: function(){
return 'Model1.someMethod returned value';
}
}, InheritedMixin));
Model2 = Model1.extend({
someMethod:function(){
return this.inherited('someMethod', arguments);
}
});
Model3 = Model2.extend({
someMethod:function(){
return this.inherited('someMethod', arguments);
}
});
model3 = new Model3();
model3.someMethod(); //invoks Model3.someMethod() -> Model2.someMethod() -> Model1.someMethod()
Trskldn/backbone.inherited
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
call super methods in the prototype chain. mixin.
Resources
Stars
Watchers
Forks
Packages 0
No packages published