2013-08-26 2 views

답변

3

당신은 같은 모델을 기존 확장 할 수 있습니다를 얻을 수

class MyModel extends Thorax.Model 
class MyModel extends Backbone.DeepModel 

을하는 것입니다 (Thorax.Model, Backbone.DeepModel) 다른 모델을 가지고 :

var YourModel = Backbone.DeepModel.extend({ 
    // your model definition; 
}).extend(Thorax.Model); 
+0

는 thorax.model의 방법은 – coool

+0

당신이하고 정확하게 보여주십시오 유지하지 않는 것 .. –

+3

는 내가 있었어야 같아요'''var에 YourModel = Backbone.DeepModel.extend ({ // 모델 정의; }). extend (Thorax.Model.prototype);''' – fantactuka

2

하나의 옵션은 Thorax t 모자에는 두 가지 속성이 있습니다. 동시에 내가 밑줄에 내장 된 제안 모든 시간을 둘 다 사용하려는 경우

Thorax.DeepModel = Thorax.Model.extend(Backbone.DeepModel.prototype); 
var YourModel = new Thorax.DeepModel.extend(
    /* Your Code Here */ 
); 

는 그러나 연장 :

_.extend(Thorax.Model.prototype, Backbone.DeepModel.prototype); 
당신이 필요로 그럼 그냥 Thorax.Model를 사용합니다.

관련 문제