当我尝试从ember.js中的子类调用基类方法时,我收到以下错误
断言失败:Ember.Object.create不再支持定义调用_super
的方法App.BaseClass = Ember.Object.extend({
sayHello: function(){
//my code
}
});
App.SubClass = App.BaseClass.extend({
//some code here
sayHellow: function(){
//some code of subclass
.
.
.
this_super(); // This causes error: Assertion failed: Ember.Object.create no //longer supports defining methods that call _super
}
});
答案 0 :(得分:0)
你应该使用this._super()
sayHello: function(){
//some code of subclass
.
.
.
this._super();
// This causes error: Assertion failed: Ember.Object.create no //longer supports defining methods that call _super
}
});