Dmitry Dmitry - 1 year ago 76
AngularJS Question

Filling the table in a loop

How to fill a table in the loop?
I have an array of values, and I want to automatically fill in the table.

<div ng-repeat="n in range" >
<th> {{[n]}} {{vm.symbal}}
{{[n].humidity}} %

And script:

var range = [];
for(var i=0;i<7;i++) {
$scope.range = range;

Answer Source

you do not need to create a range array, just iterate your list:

    <th>Day temp</th>
  <tr ng-repeat="item in">
    <td ng-bind=""></td>
    <td ng-bind="vm.symbal"></td>
    <td ng-bind-template="{{ item.humidity }} %"></td>


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download