Winod Patel Winod Patel - 3 years ago 67
AngularJS Question

how to use ng-repeat loop by number of count in angularJS

I want to bind html table row by specific count times using angularJS binding like below:

<tr ng-repeat="x in 5">

If anybody have solution, please reply as possible.

Answer Source

You can use constructor like this (no code in js required) :

var app = angular.module('myApp', []);

app.controller('myCtrl', function($scope) {

<!DOCTYPE html>
<script src=""></script>


  <div ng-app="myApp" ng-controller="myCtrl">
      <tr ng-repeat="n in [].constructor(10)  track by $index">



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