1

I'm trying to create a .ped file with my Angular project, I need a proper (table like) format for the data that I'm getting from the api. I actually need to create a table from that data, download that in a .ped file, and create a pedigree from another external tool. Right now, the file I download is just written in one line like a string. This is how I'm creating/downloading the file: html:

<a [href]="fileUrl" download={{familyId}}.ped> DOWNLOAD</a>

.ts file:

const data = 'MY DATA HERE';
const blob = new Blob([data], { type: 'application/octet-stream' });
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob));

as you can see, the variable 'data' is printed into the file. How do I format my api data into a table like shape in this variable? Just like a normal .ped file look like!

Faraz Khan
  • 121
  • 1
  • 1
  • 5

0 Answers0