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

@Pipe({
  name: 'dataFormat'
})
export class DataFormatPipe implements PipeTransform {



  transform(value: string, property: string): any[] {

    value = JSON.parse(value);

    if (!Array.isArray(value)) {
      return [];
    }

        console.log(value.map(item => item[property]));

    return value.map(item => item[property]);
  }

}