Git Product home page Git Product logo

ngx-pagination's Introduction

@99xt/ngx-pagination

npm (scoped) license

Simple pagination component for angular2+ apps.

Installation

To install this library, run:

npm install @99xt/ngx-pagination --save

Usage

example.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { ExampleComponent } from './example.component';

// Import the library
import { PaginationModule } from '@99xt/ngx-pagination';

@NgModule({
  declarations: [
    ExampleComponent
  ],
  imports: [
    BrowserModule,
    PaginationModule
  ],
  providers: [],
  bootstrap: [ ExampleComponent ]
})
export class ExampleModule { }

example.component.ts

export class ExampleComponent {
  totalRecordCount: number;
  selectedPage: number;
  recordsPerPage: number;

  constructor() {
    this.totalRecordCount = 330;
    this.recordsPerPage = 10;
    this.selectedPage = 1;
  }

  selectPage(page: number) {
    this.selectedPage = page;
    // call your page contents loading method here
  }
}

example.component.html

<pagination
  [total]="totalRecordCount"
  [limit]="recordsPerPage"
  (onSelectPage)="selectPage($event)">
</pagination>

Contributing Guide

Setting up the development environment

Clone the repository to your workstation

git clone [email protected]:99xt/ngx-pagination.git

Navigate to the project directory

cd ngx-pagination

Install and build the library

Generate all *.js, *.d.ts files

npm install
npm run build

You can find the compiled version in the dist/

Create a symlink from the dist directory to the global node_modules

cd dist
npm link

To lint all *.ts files:

$ npm run lint

Run Demo app

cd demo
npm install
npm start

Publish to NPM

Update the version in src/package.json;

npm run build
npm publish dist

License

MIT

ngx-pagination's People

Contributors

heimdallrj avatar lakindu95 avatar ngimhana avatar thinkholic avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngx-pagination's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.