Package Exports
- odata-table
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (odata-table) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
odata-table
odata-table simplifies quering OData V4 APIs using odata-query, odata-data-source, and material-dynamic-table.
Currently under development.
Installation
To install dependencies mentioned above, run the following:
npm i odata-query material-dynamic-table @angular/material @angular/cdk To install odata-table run:
npm i odata-tableGetting started
In your module include the following imports:
import { CellService } from 'material-dynamic-table';
import { OdataTableModule, OdataTextCellComponent, OdataDateCellComponent } from 'odata-table';add OdataTableModule to the imports:
imports: [
BrowserModule,
BrowserAnimationsModule,
OdataTableModule
],register string, and date cells in the constructor:
export class AppModule {
constructor(private readonly cellService: CellService) {
cellService.registerCell('string', OdataTextCellComponent);
cellService.registerCell('date', OdataDateCellComponent);
}
}Usage
<mat-odata-table url="https://services.odata.org/V4/OData/OData.svc/Products">
<mat-odata-field name="Name" displayName="Name" type="string"></mat-odata-field>
<mat-odata-field name="Description" displayName="Description" type="string"></mat-odata-field>
<mat-odata-field name="ReleaseDate" displayName="Release Date" type="date">
<mat-odata-field-option name="format" value="long"></mat-odata-field-option>
</mat-odata-field>
<mat-odata-field name="ProductDetail.Details" displayName="Details" type="string"></mat-odata-field>
<mat-odata-field name="Supplier.Name" displayName="Supplier" type="string"></mat-odata-field>
</mat-odata-table>