1.0.1 • Published 2 years ago

ngx-repeat-times v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NGX Repeat Times

Issues MIT License LinkedIn

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>

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

License

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

Contact

Nivrith - @_Nivrith_ - nivrithgomatam@gmail.com

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