У меня есть таблица повторений с 5 данными из моего запроса выбора и условие на мои данные.Я просто хочу получить значение и идентификатор ng-repeat и перенести его в мой добавленный элемент.Я новичок в Angularjs и HTML, надеюсь, вы, ребята, можете помочь.Ценю большую помощь.
Это мой HTML:
<table class="table table-bordered kl">
<thead>
<tr>
<th>ID</th>
<th>VALUE</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="d in mySelectData">
<td>{{d.ID}}</td>
<td>{{d.VALUE}} <p id="dataColor">Color</p> </td>
</tr>
</tbody>
</table>
Вот мой контроллер:
if(interval == 2000) {
$('#dataColor').empty();
$('#dataColor').append('<label> the color is {{d.VALUE}}</label>'
else {
$('#dataColor').empty();
$('#dataColor').append('<label> the color will be changed!</label>'
}
Вывод должен быть: (в моей первой загрузке)
+--------+-----------+
| ID | Value |
+--------+-----------+
| 1 | black |
+--------+-----------+
| 2 | red |
+--------+-----------+
| 3 | blue |
+--------+-----------+
| 4 | white |
+--------+-----------+
| 5 | red |
+--------+-----------+
(в моей 2-й загрузке или после 2 сек)
+--------+-----------------------------+
| ID | Value |
+--------+-----------------------------+
| 1 | black the color is black |
+--------+-----------------------------+
| 2 | red the color is red |
+--------+-----------------------------+
| 3 | blue the color is blue |
+--------+-----------------------------+
| 4 | white the color is white |
+--------+-----------------------------+
| 5 | red the color is red |
+--------+-----------------------------+
наконец
+--------+-------------------------------------+
| ID | Value |
+--------+-------------------------------------+
| 1 | black the color will be changed! |
+--------+-------------------------------------+
| 2 | red the color will be changed! |
+--------+-------------------------------------+
| 3 | blue the color will be changed! |
+--------+-------------------------------------+
| 4 | white the color will be changed! |
+--------+-------------------------------------+
| 5 | red the color will be changed! |
+--------+-------------------------------------+