#to control flow

10 messages · Page 1 of 1 (latest)

surreal olive
#

following the automatic conversion of an old application I find myself with an error that I cannot correct. can you help me please

ng generate @angular/core:control-flow
@for (line of datas; track line) {
  ...
  @for (column of columnsToDisplay; track column; let i = $index) {
    ...
    @if (column.classCss) {
      <div [ngClass]="column.classCss(line[column.field])">     // HERE ERROR  --> see picture
        ...

datas

export class TableV2LoadData<T> implements OnInit, AfterViewInit {
  public datas: T[];
...

column ( is type of TableColumn)

export interface TableColumn {
...
  field?: string;
...
  classCss?: () => {};
...
muted solstice
#

The function in classCss says it does not accept any parameters, why are you handing it a parameter?

surreal olive
muted solstice
surreal olive
muted solstice
surreal olive
muted solstice
#

It's not like you have to do them all at once, just start writing unit tests as part of your ticket or fully unit-test out all components you touch

surreal olive
#

yes I understand well.
and what's more, I'm all alone lol