|
1 | | -import { Component, CUSTOM_ELEMENTS_SCHEMA, inject, viewChild } from '@angular/core'; |
2 | | -import { IgxGridLiteCellTemplateDirective, IgxGridLiteColumnComponent, IgxGridLiteComponent, IgxGridLiteFilteringExpression, IgxGridLiteHeaderTemplateDirective, IgxGridLiteSortingExpression, IgxGridLiteSortingOptions } from "igniteui-angular/grids/lite"; |
3 | | -import { GridLiteDataService } from './data.service'; |
| 1 | +import { Component, inject, viewChild } from '@angular/core'; |
4 | 2 | import { IgxCheckboxComponent } from 'igniteui-angular'; |
| 3 | +import { |
| 4 | + IgxGridLiteCellTemplateDirective, |
| 5 | + IgxGridLiteColumnComponent, |
| 6 | + type IgxGridLiteColumnConfiguration, |
| 7 | + IgxGridLiteComponent, |
| 8 | + type IgxGridLiteFilteringExpression, |
| 9 | + IgxGridLiteHeaderTemplateDirective, |
| 10 | + type IgxGridLiteSortingExpression, |
| 11 | + type IgxGridLiteSortingOptions, |
| 12 | +} from "igniteui-angular/grids/lite"; |
| 13 | +import { GridLiteDataService, type User } from './data.service'; |
| 14 | + |
5 | 15 | @Component({ |
6 | 16 | selector: 'app-grid-lite-sample', |
7 | 17 | templateUrl: 'grid-lite.sample.html', |
8 | 18 | styleUrls: ['grid-lite.sample.scss'], |
9 | | - schemas: [CUSTOM_ELEMENTS_SCHEMA], |
10 | 19 | imports: [IgxCheckboxComponent, IgxGridLiteComponent, IgxGridLiteColumnComponent, IgxGridLiteHeaderTemplateDirective, IgxGridLiteCellTemplateDirective] |
11 | 20 | }) |
12 | 21 | export class GridLiteSampleComponent { |
13 | 22 | protected grid = viewChild<IgxGridLiteComponent<any>>('grid'); |
14 | | - protected data = []; |
| 23 | + protected data: User[] = []; |
15 | 24 | private dataService = inject(GridLiteDataService); |
16 | 25 |
|
| 26 | + public columns: IgxGridLiteColumnConfiguration[] = [ |
| 27 | + { field: 'age', header: 'Age', dataType: 'number' }, |
| 28 | + ]; |
| 29 | + |
| 30 | + public typedColumns: IgxGridLiteColumnConfiguration<User>[] = [ |
| 31 | + { field: 'email', header: 'Email', dataType: 'string' }, |
| 32 | + ]; |
| 33 | + |
17 | 34 | protected sortingExpressions: IgxGridLiteSortingExpression[] = [ |
18 | 35 | { |
19 | 36 | key: 'firstName', |
|
0 commit comments