Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Angular Expression has changed after it was checked

I have been struggling for hours to figure out how to make my code work, but I simply cant. Here is part of my code (html and typescript):

HTML

<td *ngFor="let col of columns">

  <!-- THIS DOESNT WORK -->       
    <div *ngIf="col.field == 'blabla'">
        <span>{{validate(col)}}</span>
    </div>

  <!-- THIS WORKS --> 
    <div *ngIf="col.field == 'blabla2'">
        <p-progressBar *ngIf="validateProgressBar(col) !== -1" [value]="progressValue">
        </p-progressBar>
    </div>
</td>

Typescript

validate(model: myModel) : string{
    let value = '';
    // lots of conditions where 'value' is modified

    return value;
  }

Comments