-3

How do I get the transformed array in my component.ts file after "|" has been applied? Please help.

1 Answers1

0

You can just apply the pipe in the component.

Here you can find an example using the date pipe like this:

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

class MyService {

  constructor(private datePipe: DatePipe) {}

  transformDate(date) {
    return this.datePipe.transform(date, 'yyyy-MM-dd');
  }
}

Depending on your pipe you need to modify the code to your own needs.

Tommy
  • 2,355
  • 1
  • 19
  • 48