I want to bind html table row by specific count times using angularJS binding like below:
<table>
<tr ng-repeat="x in 5">
<td>abc</td>
</tr>
</table>
If anybody have solution, please reply as possible. Thanks
You can use constructor like this (no code in js required) :
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
});
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<table>
<tr ng-repeat="n in [].constructor(10) track by $index">
<td>abc</td>
</tr>
</table>
</div>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With