| 275 | } |
| 276 | |
| 277 | @Component({ |
| 278 | template: ` |
| 279 | <table> |
| 280 | <tbody> |
| 281 | @for (row of table.getRowModel().rows; track row.id) { |
| 282 | <tr> |
| 283 | @for (cell of row.getVisibleCells(); track cell.id) { |
| 284 | <td> |
| 285 | <ng-container |
| 286 | *flexRender=" |
| 287 | cell.column.columnDef.cell; |
| 288 | props: cell.getContext(); |
| 289 | let cell |
| 290 | " |
| 291 | > |
| 292 | <span [innerHTML]="cell"></span> |
| 293 | </ng-container> |
| 294 | </td> |
| 295 | } |
| 296 | </tr> |
| 297 | } |
| 298 | </tbody> |
| 299 | </table> |
| 300 | `, |
| 301 | changeDetection: ChangeDetectionStrategy.OnPush, |
| 302 | standalone: true, |
| 303 | selector: 'app-table-test', |
| 304 | imports: [FlexRender], |
| 305 | }) |
| 306 | class TestComponent { |
| 307 | readonly expandState = signal<ExpandedState>({}) |
| 308 | |
| 309 | readonly table = createAngularTable(() => { |
| 310 | return { |
| 311 | columns: columns, |
| 312 | data: defaultData, |
| 313 | getCoreRowModel: getCoreRowModel(), |
| 314 | state: { expanded: this.expandState() }, |
| 315 | onExpandedChange: (updaterOrValue) => { |
| 316 | typeof updaterOrValue === 'function' |
| 317 | ? this.expandState.update(updaterOrValue) |
| 318 | : this.expandState.set(updaterOrValue) |
| 319 | }, |
| 320 | } |
| 321 | }) |
| 322 | } |
| 323 | const fixture = TestBed.createComponent(TestComponent) |
| 324 | fixture.detectChanges() |
| 325 |
nothing calls this directly
no test coverage detected