2

i have a form with two fields one for email and another for phone. i need to append the data from these fields into a csv file, so that we can send notification to the users who have opted for notification once the website is live. how can i do this in angularjs.

i am confused about if i have to upload csv file first or how and where the csv file will be saved and all. i am UI developer and not sure if this task will be performed on frontend on backend.

my boss is saying this is supposed to be frontend job.

4
  • this not frontend job, its backend job, you can read & modify files in server, can't do that at clientside Commented Mar 22, 2018 at 10:01
  • @Webinion CSV files are plain text files. He can. As for the OP, please tell us if you use Angular or AngularJS, and change the tags accordingly. Commented Mar 22, 2018 at 10:11
  • @Webinion: well, they could download the whole database, edit it, and reupload, but they or rather their boss would deserve to be thrown out of the next window for that... SushmitGaur: your boss is either lying or stupid (most likely the latter in my experience). the way to go is: your frontend sends the form (as a POST request, like any other web form) to the backend, there it's validated/etc and saved into the "database" (btw, csv is one of the worst storages for stuff like that, try to convince him of using a real database system; or stuff will become horribly slow horribly soon). Commented Mar 22, 2018 at 10:11
  • your boss is either lying or stupid (most likely the latter in my experience). Hahahaha lol. Commented Mar 22, 2018 at 10:15

1 Answer 1

1

It is possible in angular. check out this plugin https://www.npmjs.com/package/angular2-csv. You should probably get some idea after seeing this. Otherwise you can just write a plain javascript function to write data to CSV. There are many examples.

The file gets downloaded to the default downloads folder in you PC.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.