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

Class AppComponent

examples/angular/table/src/app/app.component.ts:116–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 `,
115})
116export class AppComponent {
117 data = makeData(50_000)
118
119 scrollElement = viewChild<ElementRef<HTMLDivElement>>('scrollElement')
120
121 sorting = signal<SortingState>([])
122
123 sortIcons = { asc: '🔼', desc: '🔽' }
124
125 getSortIcon(sorting: false | SortDirection) {
126 return sorting ? this.sortIcons[sorting] : null
127 }
128
129 columns: ColumnDef<Person>[] = [
130 {
131 accessorKey: 'id',
132 header: 'ID',
133 size: 60,
134 },
135 {
136 accessorKey: 'firstName',
137 cell: (info) => info.getValue(),
138 },
139 {
140 accessorFn: (row) => row.lastName,
141 id: 'lastName',
142 cell: (info) => info.getValue(),
143 header: 'Last Name',
144 },
145 {
146 accessorKey: 'age',
147 header: () => 'Age',
148 size: 50,
149 },
150 {
151 accessorKey: 'visits',
152 header: 'Visits',
153 size: 50,
154 },
155 {
156 accessorKey: 'status',
157 header: 'Status',
158 },
159 {
160 accessorKey: 'progress',
161 header: 'Profile Progress',
162 size: 80,
163 },
164 {
165 accessorKey: 'createdAt',
166 header: 'Created At',
167 cell: (info) => info.getValue<Date>().toLocaleString(),
168 },
169 ]
170
171 table = createAngularTable(() => ({
172 data: this.data,
173 columns: this.columns,

Callers

nothing calls this directly

Calls 2

makeDataFunction · 0.90
injectVirtualizerFunction · 0.90

Tested by

no test coverage detected