odata-table
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.203 • Public • Published

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-table

Getting 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>

Package Sidebar

Install

npm i odata-table

Weekly Downloads

0

Version

1.0.0-alpha.203

License

MIT

Unpacked Size

242 kB

Total Files

29

Last publish

Collaborators

  • idemery