angular-data-table-library
v1.0.2
Published
DataTable for Angular 2+
Downloads
38
Maintainers
Readme
Angular DataTable
- Component for creating data table for array of objects.
- It is developed using
Angular >=7.0.0
and its newly introducedng g library
schematics. - Library location:
projects/angular-data-table
directory of this repository.
Examples/Demo
Live Demo Example
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
Thanks for Installing
Conatct me for any suggestion/issues -> [email protected]