### File

`src/lib/table-column-filter/table-column-filter.service.ts`

### Index

###### Properties

- Public Readonly change

###### Methods

- Public setFilter

###### Accessors

- current

### Methods

Public setFilter
`setFilter(column: string, value: string | undefined | null)`
Defined in src/lib/table-column-filter/table-column-filter.service.ts:14

Parameters :

Name | Type | Optional
column | `string` | No
value | `string | undefined | null` | No

Returns : `void`

### Properties

Public Readonly change
Default value : `new BehaviorSubject<Record<string, string>>({})`
Defined in src/lib/table-column-filter/table-column-filter.service.ts:9

### Accessors

current
get `current()`
Defined in src/lib/table-column-filter/table-column-filter.service.ts:10

    import { Injectable } from '@angular/core';
    import { FilterLike } from '@rxap/data-source/table';
    import { clone } from '@rxap/utilities';
    import { BehaviorSubject } from 'rxjs';

    // TODO : move to rxap packages
    @Injectable()
    export class TableColumnFilterService implements FilterLike {
      public readonly change = new BehaviorSubject<Record<string, string>>({});
      public get current(): Record<string, string> {
        return clone(this.change.value);
      }

      public setFilter(column: string, value: string | undefined | null): void {
        const next = this.current;
        if (value) {
          next[column] = value;
        } else if (next[column]) {
          delete next[column];
        }
        this.change.next(next);
      }

    }

# results matching ""

# No results matching ""