ngx-repeat-times
v1.0.1
Published
A simple angular directive to repeat templates based on a number rather than an iterable
Downloads
39
Maintainers
Readme
NGX Repeat Times
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.md
for more information.
Contact
Nivrith - @_Nivrith_ - [email protected]
Project Link: https://github.com/nivrith/ngx-repeat-times