MCPcopy Index your code
hub / github.com/TanStack/table / AppComponent

Class AppComponent

examples/angular/filters/src/app/app.component.ts:32–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 changeDetection: ChangeDetectionStrategy.OnPush,
31})
32export class AppComponent {
33 readonly columnFilters = signal<ColumnFiltersState>([])
34 readonly data = signal(makeData(5000))
35
36 readonly columns: ColumnDef<Person>[] = [
37 {
38 accessorKey: 'firstName',
39 cell: info => info.getValue(),
40 },
41 {
42 accessorFn: row => row.lastName,
43 id: 'lastName',
44 cell: info => info.getValue(),
45 header: () => 'Last Name',
46 },
47 {
48 accessorKey: 'age',
49 header: () => 'Age',
50 meta: {
51 filterVariant: 'range',
52 },
53 },
54 {
55 accessorKey: 'visits',
56 header: () => 'Visits',
57 meta: {
58 filterVariant: 'range',
59 },
60 },
61 {
62 accessorKey: 'status',
63 header: 'Status',
64 meta: {
65 filterVariant: 'select',
66 },
67 },
68 {
69 accessorKey: 'progress',
70 header: 'Profile Progress',
71 meta: {
72 filterVariant: 'range',
73 },
74 },
75 ]
76
77 table = createAngularTable<Person>(() => ({
78 columns: this.columns,
79 data: this.data(),
80 state: {
81 columnFilters: this.columnFilters(),
82 },
83 onColumnFiltersChange: updater => {
84 updater instanceof Function
85 ? this.columnFilters.update(updater)
86 : this.columnFilters.set(updater)
87 },
88 getCoreRowModel: getCoreRowModel(),
89 getFilteredRowModel: getFilteredRowModel(), //client-side filtering

Callers

nothing calls this directly

Calls 10

makeDataFunction · 0.90
createAngularTableFunction · 0.90
getCoreRowModelFunction · 0.85
getFilteredRowModelFunction · 0.85
getSortedRowModelFunction · 0.85
getPaginationRowModelFunction · 0.85
getFacetedRowModelFunction · 0.85
getFacetedUniqueValuesFunction · 0.85
getFacetedMinMaxValuesFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…