ngx-repeat
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

NgxRepeat

npm version Package License NPM Downloads Snyk codecov stars forks HitCount

Angular directive for repeating HTML element by count

Angular 17 compatible

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

  • Lightweight
  • No dependencies!
  • Directive way

Install

  1. Use yarn (or npm) to install the package
yarn 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
 ]
})

Compatibility

Angular ngx-repeat Install
>= 14 2.x yarn add ngx-repeat
>= 12 1.x yarn add ngx-repeat@1
>= 5 < 13 0.x yarn add ngx-repeat@0

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

Dependencies

None

License

Copyright © 2021 - 2024 Dominik Hladik

All contents are licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i ngx-repeat

Weekly Downloads

44

Version

2.0.1

License

MIT

Unpacked Size

18 kB

Total Files

10

Last publish

Collaborators

  • celtian