Angular custom pipe not be found

Viewed 10856

In my application I need a custom pipe globally, I try to implement it following angular pipe but i see always this error

Template parse errors: The pipe 'formatdate' could not be found

formatdate.pipe

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'formatdate'
})

export class FormatdatePipe implements PipeTransform {

  transform(dateJson: any, args?: any): any {
.
 //code...
.
      return dateJson;
    }
  }
}

app.module

import { FormatdatePipe } from './shared/pipes/formatdate.pipe';
@NgModule({
  declarations: [
    AppComponent, FormatdatePipe 
  ],

This pipe works if I import it in all my module and not in the principal app.module, do I need a routin pipe module or something

1 Answers
Related