How to send form data to the server api with angular 2?

后端 未结 2 1742
梦毁少年i
梦毁少年i 2020-12-19 18:11

I\'m trying to post data from a small registration form to the server

I\'ve been stuck in this since three days now i don\'t know how to do it, i\'m still beginner i

2条回答
  •  天命终不由人
    2020-12-19 18:48

    Why not using reactive forms from Angular? What you are doing seems a lot complicated for no reason.

    Please read: Angular Reactive Forms. That should give you enough information on how to work with forms.

    Once you define form controls you can subscribe to valueChanges and react accordingly, while still having access to form (and control) values.

提交回复
热议问题