2

I upgraded from Angular 8 to Angular 9 and now i'm getting this error when i use the Table component of primeng to show some items.

enter image description here

this.columns = [
            { field: 'CodigoPostal', header: 'Codigo Postal' },
            { field: 'FechaAlta', header: 'Fecha Inicio', pipe: 'dd/MM/yyyy' },
            { field: 'FechaBaja', header: 'Fecha Fin', pipe: 'dd/MM/yyyy' }
        ];

What exactly is happening here? I'm getting this error for every item that applies the pipe when rendering the table (I upgraded primeng from 8 to 9 too)

enter image description here

Had no problems before upgrade :(

Thank you and have a nice day!

auron344
  • 81
  • 1
  • 7
  • Try to put date format in pipe directly `{{rowData[col.fixed] | date: 'dd/MM/yyyy'}}` maybe that help? – Ilija Iličić Mar 06 '20 at 10:48
  • It was my bad. had nothing to do about the migration. @Ilija Iličić Thank you anyway. Your answer made me check some things and finally i found the solution. The dates were already casted to date and then applying the pipe did some erros dont know exactly why. – auron344 Mar 06 '20 at 13:02
  • @auron344 i have exactly the same issue can you please go into detail about the fix? – Tim Sielemann Mar 16 '20 at 13:11

2 Answers2

2

This error message happens when pipe executes badly and returns no value.

By default pipes are "pure" which means that the function is not called on every change detection cycle (see What is impure pipe in Angular?). If the pipe's input value does not change, angular use the last returned value which does not exist and you have a "Stored value should never be NO_CHANGE" message in the console.

Vincent GODIN
  • 467
  • 4
  • 8
0

try like that

For Time {{ datetime || date: 'hh:mm a'}}

For Date {{ datetime || date: 'MM/dd/yyyy'}}