I have a form on an Angular2 webpage.
When I hit submit on the form, I'd like the equivalent of " method="post".....> to happen.
That is, the action script for the form is on another website, and I'd like to just post the form to that website. And to then be on that external site.
I'm beating my head against a brick wall on this; the Submit button appears to have been taken over by Angular, so just hitting Submit does nothing. I know how to do this when I need to handle the data asynchronously, but not when I want to just move to that external site.
I don't need any fancy Angular validation, etc, just to post the form to the external site, and then be on that site.
I've been reading and googling, and the only suggestion offered appears to be doing a http.post, then subscribing to the promise, then redirecting. But how does that redirect handle the data I want to submit with the form?
Any pointers welcome, thanks. Rachel
I use the pure Angular JS html to implement this requirement.
Thanks to the angular2-forms tag which showed up as an option when I posted this, I think I have found the answer at Angular2 ngNoForm and also do angular form validation
There is a (rather undocumented) option on ngForm "ngNoForm" which removes the automatic ngForm handling from this specific form. This gives me back the standard use of the Submit button, and gets the behaviour I need.
Angular is a library for providing a user interface in a browser, so to listen for an HTTP request you need an HTTP server like Apache or Nodejs with Express..
in node.js app.use(bodyParser.json()) then in app.post, we can print req.body to get all post values