the code was running fine on angular version 8.3.4 but when i updated it to the latest version of angular ( 9 ) i got the following error
following is t
Add DatePipe in the providers.It will work fine.