README.md

July 27, 2026 ยท View on GitHub

NgxRepeat

npm version Package License NPM Downloads Snyk codecov stars forks HitCount

Angular directive for repeating HTML element by count

โœ“ Angular 22 compatible

Here's the demo or stackblitz live preview or codesandbox live preview

  • Lightweight
  • No dependencies!
  • Directive way

๐Ÿ› ๏ธ Install

  1. Use Bun to install the package
bun add ngx-repeat
  1. Add NgxRepeatDirective into your component`
import { NgxRepeatDirective } from 'ngx-repeat';

@Component({
  standalone: true,
  imports: [NgxRepeatDirective /*, ...*/],
   // ...
})

or module

import { NgxRepeatDirective } from 'ngx-repeat';

@NgModule({
 // ...
 imports: [
   // ...
   NgxRepeatDirective
 ]
})

๐Ÿš€ Quick start

Example code

<div
  *ngxRepeat="3; 
    let index = index;
    let even = even;
    let odd = odd;
    let first = first;
    let last = last;"
>
  {{ index }} {{ even }} {{ odd }} {{ first }} {{ last }}
</div>

Result

  0 true false true false
  1 false true false false
  2 true false false true

๐Ÿ”ง Compatibility

Angularngx-repeatInstall
>= 225.xbun add ngx-repeat
>= 204.xbun add ngx-repeat@4
>= 193.xbun add ngx-repeat@3
>= 142.xbun add ngx-repeat@2
>= 121.xbun add ngx-repeat@1
>= 5 < 130.xbun add ngx-repeat@0

๐Ÿ“ฆ Dependencies

None

๐Ÿชช License

Copyright ยฉ 2021 - 2026 Dominik Hladik

All contents are licensed under the MIT license.