igniteui-angular
igniteui-angular copied to clipboard
IgxGridCellComponent - example code is not correct that shows how to use variables in a ng-template.
Description
The following example code is not correct. https://github.com/IgniteUI/igniteui-angular/tree/master/src/grid#example
Steps to reproduce
- Use [email protected]
- Implement
ng-templateas follows.
<igx-column field="xxx" header="xxx" dataType="string">
<ng-template igxCell let-col="column" let-ri="rowIndex" let-item="item">
<div>{{ col }}</div>
<div>{{ ri }}</div>
<div>{{ item }}</div>
</ng-template>
</igx-column>
Result
The values of column, rowIndex and item are not displayed.
Expected result
Actually, $implicit and cell are available.
<igx-column field="xxx" header="xxx" dataType="string">
<ng-template igxCell let-value="$implicit" let-cell="cell">
<div>{{ value }}</div>
<div>{{ cell }}</div>
</ng-template>
</igx-column>
Here is a context that can be referenced in a ng-template. https://github.com/IgniteUI/igniteui-angular/blob/master/src/grid/cell.component.ts#L45-L50
#777
We've made a note that the demos are experimental and the code may not be up to date, or some may not function at all at times. I'm closing this since it's a duplicate as well.
https://github.com/IgniteUI/igniteui-angular#run-experimental-demos