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

1.0.1 • Public • Published

NGX Repeat Times

Issues MIT License LinkedIn

Ngx Repeat Times

Steal this elegant trick right now to repeat templates without *ngFor


When you need to repeat templates based on a number rather than a collection or iterable like this:

<div *repeatTimes="length; index as i">
  {{ i }} This will render {{ length }} times
</div>

Installation

npm install ngx-repeat-times

Add the NgxRepeatTimesModule to the imports array of the NgModule decorator

import { NgxRepeatTimesModule } from "ngx-repeat-times";

@NgModule({
  //...
  imports: [
    //...
    NgxRepeatTimesModule,
    //...
  ],
  //...
})
export class ExampleModule {}

Usage

<!-- some.component.html -->

<div *repeatTimes="length; index as i">
  {{ i }} This will render {{ length }} times
</div>

<!-- or -->

<div *repeat="let index times length;">
  {{ index }} This will render {{ length }} times
</div>

View Source · Report Bug · Request Feature

🚀   Declarative · 🎉   Very Simple to use · 🍻   No Need to Hacking NgFor ·

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

Contact

Nivrith - @_Nivrith_ - nivrithgomatam@gmail.com

Project Link: https://github.com/nivrith/ngx-repeat-times

(back to top)

Package Sidebar

Install

npm i ngx-repeat-times

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

27.9 kB

Total Files

14

Last publish

Collaborators

  • nivrith