j8-table
v0.2.0
Published
``` import { ExpensesSearchRoutingModule } from './expenses-search-routing.module'; import { ExpensesSearchComponent } from './expenses-search.component'; import { J8TableModule } from 'j8-table';
Downloads
11
Readme
J8-Table
import { ExpensesSearchRoutingModule } from './expenses-search-routing.module';
import { ExpensesSearchComponent } from './expenses-search.component';
import { J8TableModule } from 'j8-table';
@NgModule({
declarations: [
ExpensesSearchComponent
],
imports: [
CommonModule,
ExpensesSearchRoutingModule,
J8TableModule
]
})
export class ExpensesSearchModule { }
<j8-table [data$]="expenses$" [columns]="columns"></j8-table>
expenses$: Observable<any[]> = new Observable<any[]>();
columns: j8Column[] = [
{
name: 'Name',
key: 'itemName',
type: 'link',
route: 'details/'
},
{
name: 'Cost',
key: 'cost',
type: 'currency',
format: 'PHP'
},
{
name: 'Bought Date',
key: 'boughtDate',
type: 'date',
format: 'shortDate'
},
{
name: 'Remarks',
key: 'remarks'
},
{
name: 'Action',
key: '',
styleClass: 'btn btn-sm btn-danger',
type: 'button',
value: 'Delete',
format: '',
callback: (id: number) => {
this.delete(id);
}
},
];