Skip to content

Commit

Permalink
angular v19 table adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 25, 2024
1 parent 12d0606 commit f235c08
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/angular/column-ordering/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ const defaultColumns: Array<ColumnDef<typeof _features, Person>> = [
},
]

const _features = tableFeatures({
columnVisibilityFeature,
columnOrderingFeature,
})

@Component({
selector: 'app-root',
standalone: true,
Expand All @@ -84,17 +89,14 @@ export class AppComponent {
readonly columnOrder = signal<ColumnOrderState>([])

readonly table = injectTable(() => ({
_features,
data: this.data(),
_features: {
columnVisibilityFeature,
columnOrderingFeature,
},
columns: defaultColumns,
data: this.data(),
state: {
columnOrder: this.columnOrder(),
columnVisibility: this.columnVisibility(),
},
enableExperimentalReactivity: true,
onColumnVisibilityChange: (updaterOrValue) => {
typeof updaterOrValue === 'function'
? this.columnVisibility.update(updaterOrValue)
Expand Down

0 comments on commit f235c08

Please sign in to comment.