回答

5

你可以嘗試預訂至activeInstruction觀察到在shell.js路由器的

define(['plugins/router', 'durandal/app'], function (router, app) { 

    router.activeInstruction.subscribe(function (configObject) { 
     console.log('activeInstruction', configObject); 
    }); 

。 。 。

這會給你一個配置對象,它將包含你在哪裏導航的信息。不知道這是否是最好的方法,或者即使它被設計爲以這種方式使用,但有一看,它可能會有所幫助。

+0

這絕對是處理這種情況的正確方法。 –