MCPcopy
hub / github.com/TanStack/table / TestComponent

Class TestComponent

packages/angular-table/tests/flex-render-table.test.ts:241–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 }
240
241 @Component({
242 template: `
243 <table>
244 <tbody>
245 @for (row of table.getRowModel().rows; track row.id) {
246 <tr>
247 @for (cell of row.getVisibleCells(); track cell.id) {
248 <td>
249 <ng-container
250 *flexRender="
251 cell.column.columnDef.cell;
252 props: cell.getContext();
253 let cell
254 "
255 >
256 <span [innerHTML]="cell"></span>
257 </ng-container>
258 </td>
259 }
260 </tr>
261 }
262 </tbody>
263 </table>
264 `,
265 changeDetection: ChangeDetectionStrategy.OnPush,
266 standalone: true,
267 selector: 'app-table-test',
268 imports: [FlexRender],
269 })
270 class TestComponent {
271 readonly expandState = signal<ExpandedState>({})
272
273 readonly table = createAngularTable(() => {
274 return {
275 columns: columns,
276 data: defaultData,
277 getCoreRowModel: getCoreRowModel(),
278 state: { expanded: this.expandState() },
279 onExpandedChange: updaterOrValue => {
280 typeof updaterOrValue === 'function'
281 ? this.expandState.update(updaterOrValue)
282 : this.expandState.set(updaterOrValue)
283 },
284 }
285 })
286 }
287 const fixture = TestBed.createComponent(TestComponent)
288 fixture.detectChanges()
289

Callers

nothing calls this directly

Calls 3

createAngularTableFunction · 0.90
getCoreRowModelFunction · 0.90
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…