Próbuję dołączyć szablon o kątowym ng-include
. Strona włączenie do:Angular ng-include in wrong position
<table class="table table-hover table-striped">
<thead>
<tr>
<th translate>
First
</th>
<th translate>
Second
</th>
<th translate>
Third
</th>
</tr>
</thead>
<tbody>
<ng-include src="getTemplate('default')"></ng-include>
</tbody>
</table>
Szablon:
<tr class="table-row-clickable">
<td>text1</td>
<td>text2</td>
<td>text3</td>
</tr>
Get metoda szablon:
$scope.getTemplate = function(templateName) {
return APP_CONFIG.TPL_PATH + '/path/' + templateName + '.html';
};
Obciążenia szablon porządku, widzę go na stronie, ale w złe miejsce. Oto screen z konsoli przeglądarce, The ng-include
wkładki przed tabelą, a nie wewnątrz niego:
mógłbyś pomóc mi zrozumieć, dlaczego tak jest? Z góry dziękuję.
Edycja 1, dodać renderowania przeglądarki:
chciałbym umieścić NG-zawierać na etykiecie TBODY bezpośrednio, czyli '
' –Byłam o napisaniu tego, co powiedział @Dwardu. ng-include nie używa "zamień", więc myślę, że przeglądarka może zdecydować, że jest w niewłaściwym miejscu i przenieść go na zewnątrz. – valepu