Angular 2 Form Serialization Into JSON Format

前端 未结 3 1619
无人共我
无人共我 2021-02-05 15:14

I am having a little bit of trouble creating my Angular 2 form and converting the submitted data into JSON format for the use of submitting it to my API. I am looking for someth

3条回答
  •  清歌不尽
    2021-02-05 15:40

    You are looking for JSON.stringify(object) which will give you the JSON represantation of your javascript object.

    You can then POST this using the built-in HTTP service to your server.

提交回复
热议问题