Ahsan Iqbal
Ahsan Iqbal

Reputation: 78

Post to Angular 4/5 page

I am in a situation where I have to provide a link of my web app to client & they will be posting form to my web page. The app is created on Angular 5. I have been googling around; but didn't find the the solution. I hope any of you could help me it.

<form action="http://localhost:4200/#/activateaccount" >
    <input type='Hidden' name='loginId' value='[email protected]'/>
    <input type="submit" value="Submit">
</form>

The submission code will be something like this. Where in action the link is of my Angular 5 app. Is it possible to post to Anuglar 5 page?

Thanks in advance though.

Upvotes: 2

Views: 2559

Answers (1)

salah-1
salah-1

Reputation: 1399

Post requests go to a server and Angular won’t see that since it’s running at the client side. You can post to your app’s index.html, but I doubt that’s what you want.

What you want is REST API endpoint that can accept http post.

See

How to receive POST request in an AngularJS page?

External servers posting to angular 2 routes

Upvotes: 2

Related Questions