0

If there a way to make a loop not over array, but like in C:

for(i=1;i<10;i++)

For pagination

Maxim
  • 243
  • 3
  • 18
  • did you check this one http://stackoverflow.com/questions/36095496/angular-2-how-to-write-a-for-loop-not-a-foreach-loop ? – angularrocks.com Apr 14 '17 at 08:29
  • Question not quite answered. There is no elegant solution? – Maxim Apr 14 '17 at 08:58
  • the accepted answer with the index management is the elegant solution. – Alex Beugnet Apr 14 '17 at 09:19
  • @Alex Beugnet what? – Maxim Apr 14 '17 at 09:23
  • Create pipe which will do all stuff: @Pipe({ name: 'range' }) export class RangePipe implements PipeTransform { transform(value: number, exponent: string): Array { if (!value || value <= 0) { return new Array(); } return (new Array(value)).fill(1); } } – sQer Apr 14 '17 at 13:09

0 Answers0