Demo
https://h5aaimtron.github.io//demo-ng8-data-table/ng8DataTableDemo/#
Installation
npm i ng8-data-table --save
Usage Examples
AppModule.ts
;...;
Any Component.ts import
;
Table with Pagination
NameAgeCity{{ item.name }}{{ item.email }}{{ item.age }}{{ item.city | uppercase }}
Table with Load More
NameAgeCity{{ item.name }}{{ item.email }}{{ item.age }}{{ item.city | uppercase }}Load More
API
data
directive
- selector:
ng8-data-table
- exportAs:
ng8DataTable
- inputs
data: any[]
- array of data to display in tablerowsOnPage: number
- number of rows should be displayed on page (default: 1000)activePage: number
- page number (default: 1)sortBy: any
- sort by parametersortOrder: string
- sort order parameter, "asc" or "desc"
- outputs
sortByChange: any
- sort by parametersortOrderChange: any
- sort order parameter
ng8-column-sorter
component
- selector:
ng8-column-sorter
- inputs
sortBy: any
- specify how to sort data (argument for lodash function _.sortBy )
ng8-pagination
component
Displays buttons for changing current page and number of displayed rows (css for bootstrap is required). If array length is smaller than current displayed rows on page then it doesn't show button for changing page. If array length is smaller than min value rowsOnPage then it doesn't show any buttons.
- selector:
ng8-pagination
- inputs
rowsOnPageSet: number
- specify values for buttons to change number of diplayed rows
ng8-data-filter
directive
- selector:
ng8-data-filter
- inputs
filterBy: string
- specify the field name to be filtered.filterValue: string[]
- specify an array of strings containing acceptable OR filters.
Select FilterJohn DoeTest Name
Change Log
- Added dropdown filter support
- Fixed filtering to support other types.
- Simplified packaging / installation
- Made directive naming more consistent