Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Angular datepipe cannot be found

I want to use the DatePipe in HTML

{{ timeslot | date }}

but I get the error

error NG8004: No pipe found with name 'date'

My app.module.ts imports the common module

import { CommonModule } from '@angular/common';

@NgModule({
  imports: [
     CommonModule,
  ],
  declarations: [],
}

What I am doing wrong?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Try to put your component in declarations like:

import { CommonModule } from '@angular/common';

@NgModule({
  imports: [
     CommonModule,
  ],
  declarations: [YourComponent],
}
over 4 years ago · Santiago Trujillo Report

0

All I want to do is use Angular pipe in HTML.

{{ timeslot | date }}

I spent 2 hours on this issue troubleshooting and Google searching the error message,

error NG8004: No pipe found with name 'date'.

only to get the same repeated advice for adding CommonModule to imports, or adding to providers then inject into the Component and Service files.

To help those who made the same silly mistake as I did, please check you have added your component into the app.module.ts declarations first. You don't even need to do any thing else (import CommonModule whatsoever) to use Angular pipes.

over 4 years ago · Santiago Trujillo Report

0

For larger, more complex apps, make sure the whole dependency tree is correctly imported.

I suffered this error because a piece was missing in a parent module file. Specifically, the component with the error did not have its declaring module imported into the main app module. Everything else was correct: imported the CommonModule from Angular (for the date pipe), declared the erring module in its own module, exported the erring module from its own module.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!