Skip to content

Commit 59d3423

Browse files
committed
feat: add repeat
1 parent 50a9814 commit 59d3423

File tree

1 file changed

+9
-0
lines changed
  • libs/angular-three/src/lib/directives

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { NgForOf } from '@angular/common';
2+
import { Directive, Input } from '@angular/core';
3+
4+
@Directive({ selector: '[ngFor][ngForRepeat]', standalone: true })
5+
export class NgtRepeat extends NgForOf<number> {
6+
@Input() set ngForRepeat(count: number) {
7+
this.ngForOf = Number.isInteger(count) ? Array.from({ length: count }, (_, i) => i) : [];
8+
}
9+
}

0 commit comments

Comments
 (0)