0

I have series of numbers $scope.N = [1,2,3,4]; I want to ng-repeat this in my Html code, something like JSON ng-repeat example

  <tr ng-repeat="row in categories">
       <td>{{row.category}}</td>
  </tr>

Hov to do that with array of numbers ?

1
  • do u want to show array values in a dropdown? Commented Jul 20, 2015 at 7:35

1 Answer 1

1

Something like this:

<tr ng-repeat="num in [1, 2, 3, 4, 5, 6]">
   <td ng-bind="num"></td>
</tr>

You can of course declare the array in your controller:

$scope.numbers = [1, 2, 3, 4, 5, 6];

And then use:

<tr ng-repeat="num in numbers">
   <td ng-bind="num"></td>
</tr>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.