如何在模型函数本身内访问模型的静态方法?
例如,说我有以下内容:
var Model = Backbone.Model.extend({
tableName : 'models',
someFunction: function() {
// Want to access 'someArray' here
}
}, {
someArray: ['a', 'b', 'c']
});
答案 0 :(得分:-1)
var Model = Backbone.Model.extend({
tableName : 'models',
someFunction: function() {
console.log(Model.someArray);
}
}, {
someArray: ['a', 'b', 'c']
});