http://jsfiddle.net/pauldechov/89S5p/
在root的connectOutlets中,App
似乎仍然是.initialize()
d。 connectOutlets不打算与根状态一起使用吗? (为什么?)
如果我每次加载页面时都需要一些东西(比如pangratz的NavigationView:https://stackoverflow.com/a/11629977/363073),那么我需要像他一样拥有一个包罗万象的root.index状态吗?
答案 0 :(得分:0)
正如sly7_7所指出的,这仍然是一个悬而未决的问题 - 显然这个功能被认为是可取的,但似乎需要一个不受欢迎的黑客攻击。 http://github.com/emberjs/ember.js/pull/941
现在,要么将所有路由都放在子路由中,例如root.index,要么手动绑定控制器而不是使用outlet助手(例如{{view App.NavigationView controllerBinding="App.router.navigationController"}}
)。