🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

angular2-bootstrap-pagination

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-bootstrap-pagination

angular2-bootstrap-pagination is angular2 directive. It will generate pagination or this directive must need boostrap package

2.1.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

angular2-bootstrap-pagination

angular2-bootstrap-pagination is angular2 directive.

The sources for this package are in (https://github.com/rajan-g/angular2-bootstrap-pagination.git) repo. Please file issues and pull requests against that repo.

Demo Output

pagination ###Install from npm

        npm install angular2-bootstrap-pagination

component file use like below

        /* 
 * @author RAJAN G
 */
//module file 
import {PaginationDirective} from '../directives/pagination.directive';
//include pagination directive
@NgModule({
  imports:      [ BrowserModule, FormsModule ],
  declarations: [AppComponent, PaginationDirective],
  bootstrap:    [ AppComponent ]
})

import {Component} from 'angular2/core';


@Component({
    selector: 'my-app',    
    template: `<ng-pagination [totalItems]="totalItems" [(ngModel)]="currentPage" [maxSize]="maxSize" [boundaryLinks]="true" (pageChanged)="pageChanged($event)"
previous-text="&lsaquo;" next-text="&rsaquo;" first-text="First" last-text="Last">`,
})
export class AppComponent {
  public currentPage:number = 1;
  public totalItems:number = 200; // total numbar of page not items
  public maxSize:number = 10; // max page size
    constructor() {
    }  
  public setPage(pageNo:number):void {
    this.currentPage = pageNo;    
  };

  public pageChanged(event:any):void {
//this method will trigger every page click 
    console.log('Number items per page: ' + event.itemsPerPage);
  };
}

For Test demo

  • Download this module
  • Run following command
    npm install
    npm start
    

Keywords

angular2-bootstrap-pagination

FAQs

Package last updated on 13 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts