An Angular Table View component for binding with Object Arrays.
This is still a work in progress, so the code is not hosted in NPM or any other repos. You have to manually copy the
src/app/ng-table folder and include it in your project if you want to try it.
After copying to your project, the following steps can be followed to use the NgTable component
NgTableModule into your module
NgTableModule in your module's
*.component.html or component
template or wherever you want to use NgTable, just use the
The following are the inputs that have to be provided to the
data: any: The object array which is to be displayed.
enableTitleCasedHeaders: boolean: when
true, Views column headers in title cased object properties (Example: A propery
first_name will have the column header as
enableColumnSelection: boolean: when
true, A dropdown menu is displayed, so the columns could be hidden dynamically.
The following are the events that could be emitted from the
onRowSelected: RowSelectionEvent: Event occurs whenever a row is selected.
onRowDeselected: RowSelectionEvent: Event occurs whenever a row is deselected.
RowSelectionEvent contains the last selected/deselected row in the
lastSelection property and the overall selection in the
In case of selection using Select All checkbox from the table header,
lastSelection will be
The below example will generate a table with 6 columns and 2 rows