ember 0.9.8.1 でエラーが発生します
You cannot use the same root element (body) multiple times in an Ember.Application
これは何が起こっているのか分かりますか?どこを調べる必要があるかについての提案はありますか?
ありがとう。
ember 0.9.8.1 でエラーが発生します
You cannot use the same root element (body) multiple times in an Ember.Application
これは何が起こっているのか分かりますか?どこを調べる必要があるかについての提案はありますか?
ありがとう。
DOM メンテナンスで競合するため、複数の Ember アプリケーションを同じ DOM 要素にバインドすることはできません。
それでも、同じページで複数の Ember アプリケーションをインスタンス化できます。そのようなことを試してください:
App1 = Ember.Application.create({
rootElement: '#app1'
});
App1.ApplicationController = Ember.Controller.extend();
App1.ApplicationView = Ember.View.extend({
templateName: 'app1-view'
})
App1.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
path: '/'
})
})
});
App2 = Ember.Application.create({
rootElement: '#app2'
});
App2.ApplicationController = Ember.Controller.extend();
App2.ApplicationView = Ember.View.extend({
templateName: 'app2-view'
})
App2.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
path: '/'
})
})
});
ここでは、rootElement
プロパティを使用して、アプリがバインドする DOM 要素を明示的に設定します。
デフォルトでは、Ember アプリは にバインドされるbody
ため、2 回あると競合します...