| 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…