Angular 9 - Stored value should never be NO_CHANGE

Viewed 2510

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!

2 Answers

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.

try like that

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

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

Related