angular-data-table-library
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Angular DataTable

downloads npm version

  • Component for creating data table for array of objects.
  • It is developed using Angular >=7.0.0 and its newly introduced ng g library schematics.
  • Library location: projects/angular-data-table directory of this repository.

Examples/Demo

Live Demo Example

angular-data-table

Installation

npm i angular-data-table-library

API

import { AngularDataTableModule } from 'angular-data-table-library'
selector: ang-data-table

@Inputs()

Input Type Required Description
data object YES array of objects that need to be shown in the data table .
itemPerPage number Optional, default: 12 items to be shown on each page.
color string Optional, default: Black set color of table header and button, color list

Usage

  • Register the AngularDataTableModule in module.
import { AngularDataTableModule } from 'angular-data-table-library';
 
@NgModule({
 declarations: [],
 imports: [ AngularDataTableModule],
 providers: [],
 bootstrap: []
})
export class AppModule {}
  • Use of component via selector 'ang-data-table'.
 
@Component({
  selector: 'angDataTable',
  template: `<ang-data-table [data]='data' [itemPerPage]='dataPerPage' [color]='color'>`,
})
export class AppComponent {
 
  ngOnInit() {
    let data = {
          [key1: value, key2: value],
          [key1: value, key2: value],
          [key1: value, key2: value]
      } 
    let dataPerPage = 6;
    let color = 'Blue';
  }
}
 

Test

Run tests

npm test

License

MIT © Vishal Hasnani

Thanks for Installing

Conatct me for any suggestion/issues -> hasnanivishal@gmail.com

/angular-data-table-library/

    Package Sidebar

    Install

    npm i angular-data-table-library

    Weekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    162 kB

    Total Files

    26

    Last publish

    Collaborators

    • hasnanivishal