【发布时间】:2012-07-20 21:34:50
【问题描述】:
不幸的是,我已经四处搜索,但没有找到此问题的重复项。
文件1:
var Graph = Backbone.View.extend({
move: function() {
//some stuff
}, //more stuff
})
文件 2:
define ([ './graph.js' ]), function( graph ) {
var SubGraph = Backbone.View.extend({
// this file needs to inherit what is within the move method but extend it to include other stuff
})
如何在不破坏现有属性的情况下扩展继承的属性?
【问题讨论】:
-
您能否详细说明您的期望?
-
我认为你可以做
var SubGraph = Graph.extend(...,以设置继承,但我不确定......(我过去只处理过一次Backbone)
标签: javascript oop backbone.js prototype