0.2.5 • Published 5 years ago

@dlarsson-se/sortable-table v0.2.5

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Sortable Table

A library for sorting of table data.

Installation

npm install @dlarsson-se/sortable-table -S

StackBlitz

StackBlitz Example

Example Usage

app.module.ts

import { SortableTableModule } from '@dlarsson-se/sortable-table;

@NgModule({
  imports: [ SortableTableModule.forRoot() ]  
})
export class AppModule { }

app.component.html

<table sortableTable [sortableData]="tableData">
  <thead>
    <tr>
      <th sortBy="id">ID</th>
      <th sortBy="name">Name</th>
      <th sortBy="position">Position</th>
      <th sortBy="salary">Salary</th>
      <th sortBy="start_date">Start Date</th>
      <th sortBy="office">Office</th>
      <th sortBy="extn">Extension</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of tableData">
      <td>{{data.id}}</td>
      <td>{{data.name}}</td>
      <td>{{data.position}}</td>
      <td>{{data.salary}}</td>
      <td>{{data.start_date}}</td>
      <td>{{data.office}}</td>
      <td>{{data.extn}}</td>
    </tr>
  </tbody>
</table>

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

npm run format
npm run lint
0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago