TanStack
Table API Reference

TanStackTable

Class: TanStackTable<TFeatures, TData>

Defined in: packages/angular-table/src/helpers/table.ts:59

Provides a TanStack Table instance (AngularTable) in Angular DI.

The table can be injected by:

  • any descendant of an element using [tanStackTable]="..."
  • any component instantiated by *flexRender when the render props contains table

Example

html
<div [tanStackTable]="table">
  <app-pagination />
</div>
ts
@Component({
  selector: 'app-pagination',
  template: `
    <button (click)="prev()" [disabled]="!table().getCanPreviousPage()">Prev</button>
    <button (click)="next()" [disabled]="!table().getCanNextPage()">Next</button>
  `,
})
export class PaginationComponent {
  readonly table = injectTableContext()

  prev() {
    this.table().previousPage()
  }
  next() {
    this.table().nextPage()
  }
}

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Constructors

Constructor

ts
new TanStackTable<TFeatures, TData>(): TanStackTable<TFeatures, TData>;

Returns

TanStackTable<TFeatures, TData>

Properties

table

ts
readonly table: InputSignal<AngularTable<TFeatures, TData>>;

Defined in: packages/angular-table/src/helpers/table.ts:68

The current TanStack Table instance.

Provided as a required signal input so DI consumers always read the latest value.