2015-01-02 30 views

回答

1

創建一個SettingsIndexRoute並在它們到達該路線時重定向。只有當你點擊資源的根目錄時,索引路線纔會被擊中。

App.SettingsIndexRoute = Em.Route.extend({ 
    redirect: function(){ 
    // I'm assuming overview is a route under settings 
    // and not a resource under it 
    this.transitionTo('settings.overview'); 
    } 
}); 
+0

謝謝 - 我使用的是ember-cli,所以創建了一個/routes/settings/index.js文件並添加了這個功能 - 效果很好。 – Sam