0

I have a csv file that i need to download and display in a table. What i am trying to do is download the file from a server and convert its contents into an object in angular6.

for example i have a file in http://example.com/myFile.csv

But Im unable to do so, What is the correct way to do it?

thanks to anyone who answers.

1 Answer 1

1

In order to download the file from serve. you can write a function in service using http.

this.http.get('assets/file.csv', {responseType: 'text'}) .subscribe( data => { console.log(data); }, error => { console.log(error); } ); 

Then you can read each line of csv file and save them in object/array.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.