How do I send a POST request with all parameters from a form using an AngularJS directive?

11 views
Skip to first unread message

Tom Tanner

unread,
Mar 1, 2018, 11:42:35 PM3/1/18
to Angular and AngularJS discussion
I have made an AngularJS form that integrates Stripe thru a directive. Fiddle here: https://jsfiddle.net/u5h1uece/.

Instead of using form.submit(), I want to use $http.post() to send the form parameters and data to my backend, then send back any data from there in a .then() function. In this case, the parameters include reg.email's value.

How do I do this with the way my form is set up? I'd prefer using ng-submit, but if that's not possible, is there another way?


StackOverflow question if you want SO points: https://stackoverflow.com/questions/49062620/how-do-i-send-a-post-request-with-all-parameters-from-a-form-using-an-angularjs?noredirect=1#comment85130941_49062620

Reply all
Reply to author
Forward
0 new messages