igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

IgxGridCellComponent - example code is not correct that shows how to use variables in a ng-template.

Open tkiryu opened this issue 8 years ago • 2 comments

Description

The following example code is not correct. https://github.com/IgniteUI/igniteui-angular/tree/master/src/grid#example

Steps to reproduce

  1. Use [email protected]
  2. Implement ng-template as 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

tkiryu avatar Mar 26 '18 14:03 tkiryu

#777

rkaraivanov avatar Mar 26 '18 15:03 rkaraivanov

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

kdinev avatar Mar 26 '18 15:03 kdinev