3
我想用小部件方法(組件隔離),設置rootElement爲
Ember應用程序,每個應用程序都有自己的路由器和存儲(如有必要)。使用Ember的Widget方法
我在http://jsfiddle.net/4xWep/2/ 上做了一次不成功的嘗試也許在路由器實例之間存在干擾問題。 它具有不同的應用程序和路由器的這種小部件方法嗎?
App1 = Ember.Application.create({
rootElement: '#app1'
});
App1.ApplicationController = Ember.Controller.extend();
App1.ApplicationView = Ember.View.extend({
templateName: 'app1-view'
})
App1.Router = Ember.Router.extend({...})
var App2 = Ember.Application.create({
rootElement: '#app2'
});
App2.ApplicationController = Ember.Controller.extend();
App2.ApplicationView = Ember.View.extend({
templateName: 'app2-view'
})
App2.Router = Ember.Router.extend({...})
我在考慮與它們之間的弱關係的組件。 類似於Portlet或可插拔用戶界面軟件組件。 通常,部署在分佈式環境中的一些相關應用程序共享一些用戶界面組件。將這些組件添加爲'Ember.Application'會很有用。 雖然我明白用這種方法你必須對文檔進行分段,因爲你的 不能在同一頁面中嵌套應用程序。 – acs
@acs給出一個您設想的應用程序/窗口小部件場景的示例,它會更容易幫助。 – sabithpocker
這是一個類似的問題@MikeAski回答了一會兒回來http://stackoverflow.com/questions/11391333/emberjs-develop-a-component-in-isolation-with-its-own-routing-states-which-can – sabithpocker