升级到v1.0.0-pre.3时,出现以下错误:
Uncaught Error: assertion failed: Ember.Object.create no longer supports defining methods that call _super.
出于性能原因,在createWithMixins()
中保留了原始的create()功能。这里的答案相当清楚:
https://github.com/emberjs/ember.js/commit/c1c720781c976f69fd4014ea50a1fee652286048
https://github.com/emberjs/ember.js/pull/1623#issuecomment-11699639
Ember.Application.create with mixin and parameters
但是一旦我做出改变,我现在就会收到这个错误:
Uncaught Error: assertion failed: Application initialize may only be called once
搜索我的代码库,我只运行一次App.initialize()。
(function(root){
require(["config"], function(config){
requirejs.config(config);
require(["App", "domReady!", "ember"], function(App, doc, Ember){
var app_name = config.app_name || "App";
root[app_name] = App = Ember.Application.create(App);
!App.isInitialized && App.initialize();
});
});
})(this);
有什么想法吗?
答案 0 :(得分:2)
我相信您不需要使用新版本调用初始化。