0.0.3 • Published 11 months ago

@manthanankolekar/ng-pagination v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

Ng Pagination Library

This is a simple pagination library for Angular 2+ applications. It is a simple component that can be used to paginate any list of items.

Installation

To install this library, run:

npm install @manthanankolekar/ng-pagination

Usage

Import in your app.component.ts:

import { Component } from '@angular/core';

import { NgPaginationComponent } from '@manthanankolekar/ng-pagination';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [
    NgPaginationComponent
  ],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'ng-pagination';
  currentPage = 1;

  onPageChange(page: number) {
    this.currentPage = page;
  }

  constructor() {}

  ngOnInit() {}
}

Add the following to your app.component.html:

<ng-pagination [totalItems]="100" [itemsPerPage]="10" [currentPage]="currentPage" (pageChange)="onPageChange($event)"></ng-pagination>

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

0.0.3

11 months ago

0.0.2

1 year ago

0.0.1

1 year ago