0
A
回答
5
你可以嘗試預訂至activeInstruction觀察到在shell.js路由器的
define(['plugins/router', 'durandal/app'], function (router, app) {
router.activeInstruction.subscribe(function (configObject) {
console.log('activeInstruction', configObject);
});
。 。 。
這會給你一個配置對象,它將包含你在哪裏導航的信息。不知道這是否是最好的方法,或者即使它被設計爲以這種方式使用,但有一看,它可能會有所幫助。
相關問題
- 1. 在shell.js中不能要求('durandal/app')
- 2. Durandal 2.0 shell.js沒有在每個視圖中運行
- 3. 在Windows 10中檢測GridView中ScrollViewer的ViewChanged事件
- 4. durandal中的ctrl + shift + t事件
- 5. 使用Durandal/Knockout的Bootstrap「show.bs.tab」事件
- 6. durandal事件無法正常工作
- 7. Durandal淘汰賽點擊事件
- 8. Durandal導航事件訪問viewmodels
- 9. Durandal中的條件路由
- 10. Durandal中的多級路由
- 11. Durandal Wijmo問題
- 12. Durandal Composition
- 13. 在某個事件後啓用durandal路由器導航屬性
- 14. durandaljs可以有多個shell.js嗎?
- 15. Durandal插件無法加載
- 16. 如何在Durandal中使用cshtml文件?
- 17. Durandal路線中的Asterix(*)
- 18. Durandal中的多個foreach
- 19. Durandal Routing
- 20. 在Durandal中加載Adsense
- 21. Durandal 2.0 Widget Disposal
- 22. Durandal對話框
- 23. 在Durandal中加載jquery函數 - 計時
- 24. ko.bindingHandler問題與Durandal
- 25. 在Durandal中加載jwplayer
- 26. 在Durandal中實施Sidr
- 27. bootstrap 3在Durandal 2.0.1中的模式
- 28. 使用兒童路由器時的Durandal路由器/生命週期事件
- 29. 在durandal中使用挖空網頁
- 30. Durandal入門
這絕對是處理這種情況的正確方法。 –