2016-09-20 70 views
0

就在我進入這裏的問題是我的項目結構的概述迪朗達爾子路由器沒有找到意見

-- Common 
    --services 
    --views 
    --viewmodels 
-- Product1 
    --services 
    --views 
     -- mywork 
      -- overview.html 
      -- sections 
       -- audit.html 
       -- completed.html 
       -- attention.html 
       -- index.html 
    --viewmodels 
     -- mywork 
      -- overview.js 
      -- sections 
       -- audit.js 
       -- completed.js 
       -- attention.js 
       -- index.js 

現在我已經成立了一個產品1款名爲包含兒童路由器MYWORK。 shell.js中的核心路由是使用splat設置的。

{ route: 'myWork*details', moduleId: 'product1/viewmodels/myWork/overview', title: 'My Work' } 

然後創建子航作爲

var childRouter = router.createChildRouter() 
      .makeRelative({ moduleId: 'product1/viewmodels/mywork/sections', fromParent: true }) 
      .map([ 
       { route: [''], moduleId: 'index', title: 'Overview', icon: 'fa-cogs', nav: false }, 
       { route: 'audits', moduleId: 'audits', title: 'Audits', icon: 'fa-list', nav: true }, 
       { route: 'completed', moduleId: 'completed', title: 'Tracked Records', icon: 'fa-list', nav: true }, 
       { route: 'attention', moduleId: 'attention', title: 'Requires Attention', icon: 'fa-list', nav: true } 
      ]).buildNavigationModel(); 

的主要問題是,通過導航欄,我給出的錯誤...訪問任何網頁時

View Not Found. Searched for "product1/views/mywork/sections/audits" via path "text!product1/views/mywork/sections/audits.html". 

然而,概覽頁面的視圖可以通過路由['']正確定義。任何想法,爲什麼我的其他意見不被發現,即使視圖模型是什麼,什麼是文本!錯誤之前的路徑?

回答

0

注意:子路由在HTML文件中至少需要一個<div></div>標記,我認爲這是由於某種類型的id分配,否則該子視圖將不會被子路由器找到。