-4
<div ng-repeat="10">Text</div>

I don't have any object to use and I want it in Angular, not AngularJS or any other framework. Please make sure your solution support the latest Angular.

VinayD
  • 1
  • 1
  • 3

3 Answers3

2

Try like this:

Typescript:

  fakeArray(length: number): Array<any> {
    if (length >= 0) {
      return new Array(length);
    }
  }

HTML:

<div *ngFor="let item of fakeArray(10);"></div>
Adrita Sharma
  • 21,581
  • 10
  • 69
  • 79
0

<div *ngFor="let item of itemList">{{item}}</div>

Ankit Mishra
  • 179
  • 1
  • 3
  • 15
0

in .ts file:->

nth_time = [1,2,3,4,5,6,7,8,9,10];

in .html:->

<div *ngFor="let time of nth_time">{{time}}</div>

i hope this will help you.

pk_teckie
  • 147
  • 3
  • 17