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

@Pipe({
  name: 'dataToName'
})
export class DataToNamePipe implements PipeTransform {

  transform(value: any[], ...args: any[]): any {
    if(Array.isArray(value)){
      return value.map(v => v[args[0]]).join(args[1]);
    }else{
      return '';
    }

  }

}
