Angular does provide some support for a for loop using numbers within its HTML directives:
do something
<
The code below defines a method range() available to the entire scope of your application MyApp. Its behaviour is very similar to the Python range() method.
angular.module('MyApp').run(['$rootScope', function($rootScope) {
$rootScope.range = function(min, max, step) {
// parameters validation for method overloading
if (max == undefined) {
max = min;
min = 0;
}
step = Math.abs(step) || 1;
if (min > max) {
step = -step;
}
// building the array
var output = [];
for (var value=min; value
With one parameter:
{{ i }},
0, 1, 2,
With two parameters:
{{ i }},
1, 2, 3, 4,
With three parameters:
{{ i }},
-2, -1.5, -1, -0.5, 0, 0.5,