akveo / akveo/ng2-smart-table

[BUG] Error: ExpressionChangedAfterItHasBeenCheckedError

Abierto
#365 0 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
1.6k
Forks
867
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Problem**
I have a `valuePrepareFunction` that is calculating time from now using a momentjs method. If I load the table and a cell has a value of "a minute ago", then after 1 minute passes, the view value updates to "two minutes ago". Then when I try to sort/filter the error: ExpressionChangedAfterItHasBeenCheckedError is thrown and the table freezes. User can no longer interact with the table.

I believe this template is the culprit: https://github.com/akveo/ng2-smart-table/blob/master/src/ng2-smart-table/components/cell/cell-view-mode/view-cell.component.ts.

I think the error occurs because `cell.getValue()` is directly bound to in the view & changes due to the `valuePrepareFunction`. There should be a way to handle this updated view value gracefully & avoid having the table lock up/freeze. I'm still digging into this issue. Will report back with any interesting findings. Or will submit PR.

Links to information about the error:
https://github.com/angular/angular/issues/14748
https://github.com/angular/angular/issues/15464
https://stackoverflow.com/questions/39787038/how-to-manage-angular2-expression-has-changed-after-it-was-checked-exception-w

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.