Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@agentender/odata-data-source
Advanced tools
Data source for material table and angular cdk table that can work with OData version 4 API.
Data source for material table and angular cdk table that can work with odata version 4 api. It supports sorting with MatSort and pagination with MatPaginator as well as per column filtering.
Online demo: https://stackblitz.com/edit/odata-data-source
Demo with dynamic table: https://stackblitz.com/edit/dynamic-table-odata
npm install --save odata-data-source @angular/cdk odata-query
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app';
@NgModule({
...
imports: [
...
HttpClientModule
],
})
export class AppModule {}
import { HttpClient } from '@angular/common/http';
constructor(private readonly httpClient: HttpClient) {}
@Component({
selector: 'app',
templateUrl: './app.component.html',
})
export class AppComponent {
const resourcePath = 'https://services.odata.org/V4/OData/OData.svc/Products';
this.dataSource = new ODataDataSource(this.httpClient, resourcePath);
}
<table cdk-table [dataSource]="dataSource">
...
</table>
Name | Description |
---|---|
selectedFields: string[] | Properties to select from the odata api |
sort: MatSort | Instance of the MatSort directive used by the table to control its sorting. Sort changes emitted by the MatSort will trigger a request to get data from the api. |
paginator: MatPaginator | Instance of the MatPaginator component used by the table to control what page of the data is displayed. Page changes emitted by the MatPaginator will trigger a request to get data from the api. |
filters: ODataFilter[] | Array of filters that implement ODataFilter interface. Setting filters will trigger a request to get data from the api. |
initialSort: string[] | Sort that will be applied initialy, which will be overriden when manual sort is performed. Data can be sorted by multiple columns. Follow column name with 'desc' for descending order: 'columnName desc'. |
data: any[] | Result last propagated to subscribed observers. Setting this value would update subscribed observers. |
loading: Observable | Observable that indicates if data is being loaded. |
errors: Observable | Observable that indicates errors being returned from the OData api. Emits errors from httpClient or null when they are cleared by subsequesnt successful requests. |
refresh() | Triggers a new request to refresh the data. |
ODataFilter has getFilter() method which needs to return an object that conforms to odata-query filter definition. Individual filters are then composed together using 'and' operator.
FAQs
Data source for material table and angular cdk table that can work with OData version 4 API.
The npm package @agentender/odata-data-source receives a total of 3 weekly downloads. As such, @agentender/odata-data-source popularity was classified as not popular.
We found that @agentender/odata-data-source demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.