I am trying to instantiate a DatePipe object in my Angular2 application to use the transform(...) function in the component that I am developing.
// ... import { DatePipe } from '@angular/common'; @Component({...}) export class PanelComponent implements OnInit { // ... datePipe: DatePipe = new DatePipe(); // Error thrown here // ... }
This code segment worked great in RC5. Now I am trying to upgrade to Angular2 final release and get this error when I run ng serve or ng build ,
~/tmp/broccoli_type_script_compiler-input_base_path-XitPWaey.tmp/0/src/app/panel/panel.component.ts (33, 24): Supplied parameters do not match any signature of call target.
How can I solve this problem? Is there any other way to instantiate a pipe? Or did Angular stop supporting Pipes instantiation inside components?
source share