Skip to content

Commit a20054f

Browse files
committed
fix(grid): make the cell required in cell template context
1 parent 97367eb commit a20054f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { formatCurrency, formatDate, PlatformUtil } from '../core/utils';
2424
import { IgxGridSelectionService } from './selection/selection.service';
2525
import { HammerGesturesManager } from '../core/touch';
2626
import { GridSelectionMode } from './common/enums';
27-
import { CellType, ColumnType, GridType, IGX_GRID_BASE, RowType } from './common/grid.interface';
27+
import { CellType, ColumnType, GridType, IgxCellTemplateContext, IGX_GRID_BASE, RowType } from './common/grid.interface';
2828
import { getCurrencySymbol, getLocaleCurrencyCode } from '@angular/common';
2929
import { GridColumnDataType } from '../data-operations/data-util';
3030
import { IgxRowDirective } from './row.directive';
@@ -210,10 +210,11 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT
210210
*
211211
* @memberof IgxGridCellComponent
212212
*/
213-
public get context(): any {
213+
public get context(): IgxCellTemplateContext {
214214
const ctx = {
215215
$implicit: this.value,
216-
additionalTemplateContext: this.column.additionalTemplateContext
216+
additionalTemplateContext: this.column.additionalTemplateContext,
217+
cell: this
217218
};
218219
if (this.editMode) {
219220
ctx['formControl'] = this.formControl;

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ export interface IgxCellTemplateContext {
775775
additionalTemplateContext: any,
776776
formControl?: FormControl<any>,
777777
defaultErrorTemplate?: TemplateRef<any>,
778-
cell?: CellType
778+
cell: CellType
779779
}
780780

781781
export interface IgxRowSelectorTemplateContext {

0 commit comments

Comments
 (0)