RepeatPipe
Import
Usage
Basic
Use the repeat
pipe as an easy way to loop over a number of iterations.
This will produce the following output:
With NgFor
The pipe can also be utilized with the ngFor
directive.
This will produce the same output as above.
Change start point
You can specify a startAt
value as the second argument passed into the pipe.
This will produce the following output:
API
Inputs
length: number
- A non-negative integer, specifying the number of iterations.startAt: number
- A integer, specifying the start point of iterations.
Validation
- An error is thrown if
length
is either negative or not an integer. - An error is thrown if
startAt
is not an integer.