2014-02-14 20 views
1

我正在試圖圍繞transitionTo在ember中調用的事件序列進行打包。路由轉換的事件序列To calls

我的路由器看起來如下:

App.Router.map(function() { 
    this.resource('store', {path: 'store/:store_id'} , function(){ 
     this.route("index", { path: "/" }); 
     this.resource('client', function(){ 
      this.route("signout"); 
     }); 
    }); 
}); 

在登出我清除一切,然後transitionTo回store.index但是當我這樣做沒有被刷新,並沒有模型,也不StoreIndexRoute的setupController鉤被召回。

讓StoreIndexRoute自行重置的最佳方式是什麼?

此外,解釋這些事件序列的任何資源都會很棒。

回答

1

將以下代碼添加到代碼中,然後在查看控制檯時運行。您將能夠看到路由轉換的詳細說明,這將使您更容易瞭解發生的情況和時間:

window.App = Ember.Application.create({ 
    // Basic logging, e.g. "Transitioned into 'post'" 
    LOG_TRANSITIONS: true, 

    // Extremely detailed logging, highlighting every internal 
    // step made while transitioning into a route, including 
    // `beforeModel`, `model`, and `afterModel` hooks, and 
    // information about redirects and aborted transitions 
    LOG_TRANSITIONS_INTERNAL: true 
});