2016-08-31 12 views
1

コードは次のようにレンダリングされています。 -'template'を介してディレクティブで追加された行がテーブルの上部に追加されていますか?

ディレクティブのテンプレートが一番上にあり、その後、theadがレンダリングされていますが、その上にあることが予想されます。ここ

は(trを見込んで)これはあなたの指示にdirタグを期待していないディレクティブ

app.directive('dir', function() { 
      return { 
       restrict: 'E', 
       replace: true, 
       template: '<tr><td>asdf</td></tr>' 
      }; 
}); 

答えて

2

tbodyあるHTML

<div class="panel_content"> 
    <table summary="A table listing various other formats for this product"> 
     <thead> 
     <tr> 
      <th scope="col">Other Formats</th> 
      <th scope="col" class="site amount"><span>price</span></th> 
      <th scope="col" class="market_place amount"><span>New from</span></th> 
      <th scope="col" class="market_place amount"><span>Used from</span></th> 
      <th scope="col" class="market_place amount"><span></span></th> 
      <th scope="col" class="market_place amount"><span></span></th> 
     </tr> 
     </thead> 
     <tbody> 
      <dir></dir> 
     </tbody> 
    </table> 
    </div> 

です。

app.directive('dir', function() { 
      return { 
       restrict: 'A', 
       replace: true, 
       template: '<tr><td>asdf</td></tr>' 
      }; 
}); 

<tbody> 
    <tr dir></tr> 
</tbody> 
を使用しますようにコードを変更してみてください
関連する問題