I am having a problem to use loop in angular. See below scenario.
JavaScript code:
for(int i=0;i<6;i++) {
for(int j=0;j<6;j++) {
id=i+j;
}
}
How can I do the same in my angular html?
I am having a problem to use loop in angular. See below scenario.
JavaScript code:
for(int i=0;i<6;i++) {
for(int j=0;j<6;j++) {
id=i+j;
}
}
How can I do the same in my angular html?
You can use ng-repeat. Like this:
<div ng-repeat="x in [] | range:6">
<label ng-repeat="y in [] | range:6">{{x * y}}</label>
</div>
you can not use for loop in html but you can run loop using ng-repeat in html.This link may help you AngularJS For Loop with Numbers & Ranges