-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.

1
  • Which version of angular are you using? Commented Sep 10, 2019 at 9:50

3 Answers 3

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>
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.