2017-04-09 20 views
0

我想要獲取在InlineViewStrategy中打包的視圖。如何使用InlineViewStrategy獲得撰寫視圖的工作

在自定義模板的簡單,「硬編碼」表視圖在一個較高的水平div標籤(「x_content」)的上下文中的作品作爲賣方表示花費保持低於送入InlineViewStrategy

'     <table class="" style="width:100%">', 
    '      <tr>', 
    '       <th style="width:37%;">', 
    '       <p>Top 5</p>', 
    '       </th>', 
    '       <th>', 
    '       <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">', 
    '        <p class="">Vendor</p>', 
    '       </div>', 
    '       <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">', 
    '        <p class="">Progress</p>', 
    '       </div>', 
    '       </th>', 
    '      </tr>', 
    '      <tr>', 
     '       <td>', 
     '        <canvas id="canvas1" height="140" width="140" style="margin: 15px 10px 10px 0"></canvas>', 
     '       </td>', 
     '       <td>', 
     '        <table class="tile_info">', 
     '         <tr>', 
     '         <td>', 
     '          <p><i class="fa fa-square blue"></i>Vendor 1 </p>', 
     '         </td>', 
     '         <td>30%</td>', 
     '         </tr>', 
    '        </table>', 
     '       </td>', 
    '      </tr>', 
    '     </table>', 

The data in Vendor Spend Maintain

如果我嘗試在html文件(即test-view.html)中放置相同的內容(逐字包裹模板)並在test-view.html中編寫,用compose AND替換HTML通過InLoneViewStrategy,我得到一個空白屏幕

<compose view="./test-view.html"> </compose> 

我在控制檯上得到「未處理的拒絕錯誤:爲模塊加載超時:template-registry-entry!test-view.html,text!test-view.html」。是否有其他地方我應該把這個測試view.html?或者我錯過了什麼?

to be more specific 
[ 
' ... ' 
'   <div class="x_content">   ', 
'  HTMLTABLE STUFF ', 
'   </div>       ' 
' ...   ].join(" ") 

通過

[ 
    ' ... ' 
    '   <div class="x_content">   ', 
    ' <compose view="./test-view.html"> </compose>', 
    '   </div>       ' 
    ' ...   ].join(" ") 
在自定義模板

,然後將其傳遞給InlineViewStrategy

謝謝您的幫助提前被替換。

回答

0

test-view.html必須在相關目錄中...在這種情況下,在src級別