У меня проблема с моим HTML шаблоном. Мне нужно умножить блок кода внутри таблицы, как показано ниже. Если возможно с использованием ng-repeat. Я работаю с ANGULARJS.
Ниже мой шаблон:
<div class="ngdialog-message" style="height: 100%; padding: 1em 0em;">
<div style="overflow: auto; height: 100%;">
<div class="container-fluid" style="padding: 0 2em;">
<div class="row">
<h2>COMPARISON OF PARTS</h2>
<table class="table table-hover table-bordered table-compare" style="border-collapse: separate; border: 2px solid #e2e2e2; border-radius: 8px; -moz-border-radius: 8px">
<tr>
<th>Part Number:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
<strong>{{part.part_number}}</strong>
</td>
</tr>
<tr>
<th>Status:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.IsPreferredPart}}
</td>
</tr>
<tr>
<th>Description:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.Description}}
</td>
</tr>
<tr>
<th>Part type:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.PrimaryPartType}}
</td>
</tr>
<tr>
<th rowspan="3">Components:</th>
<td>Component No </td>
<td>Diameter Min</td>
<td>Diameter Max</td>
</tr>
<tr>
<td>{{part.components[0].part_number}}</td>
<td>{{part.components[0].diameterMin}}</td>
<td>{{part.components[0].diameterMax}}</td>
</tr>
<tr>
<td>{{part.components[1].part_number}}</td>
<td>{{part.components[1].diameterMin}}</td>
<td>{{part.components[1].diameterMax}}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
А вот некоторый шаблон, где я вручную добавил блоки кода, которые дали мне необходимый результат ( также показано ниже):
<div class="ngdialog-message" style="height: 100%; padding: 1em 0em;">
<div style="overflow: auto; height: 100%;">
<div class="container-fluid" style="padding: 0 2em;">
<div class="row">
<h2>COMPARISON OF PARTS</h2>
<table class="table table-hover table-bordered table-compare" style="border-collapse: separate; border: 2px solid #e2e2e2; border-radius: 8px; -moz-border-radius: 8px">
<tr>
<th>Part Number:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
<strong>{{part.part_number}}</strong>
</td>
</tr>
<tr>
<th>Status:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.IsPreferredPart}}
</td>
</tr>
<tr>
<th>Description:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.Description}}
</td>
</tr>
<tr>
<th>Part type:</th>
<td colspan="3" ng-repeat="part in selectedParts.loadedParts">
{{part.PrimaryPartType}}
</td>
</tr>
<tr>
<th rowspan="3">Components:</th>
<td>Component No </td>
<td>Diameter Min</td>
<td>Diameter Max</td>
<td>Component No </td>
<td>Diameter Min</td>
<td>Diameter Max</td>
<td>Component No </td>
<td>Diameter Min</td>
<td>Diameter Max</td>
</tr>
<tr>
<td>A_XXX_XX1</td>
<td>10</td>
<td>20</td>
<td>A_XXX_XX2</td>
<td>10</td>
<td>20</td>
<td>A_XXX_XX3</td>
<td>10</td>
<td>20</td>
</tr>
<tr>
<td>B_XXX_XX1</td>
<td>1.0</td>
<td>2.0</td>
<td>B_XXX_XX2</td>
<td>1.0</td>
<td>2.0</td>
<td>B_XXX_XX3</td>
<td>1.0</td>
<td>2.0</td>
</tr>
</table>
</div>
</div>
</div>
</div>