MikeOne is correct.
Add ngNoForm
to your form
<form ngNoForm method="post" action="http://other-server/">
<input name="something"
value="somevalue"/>
<button name="submit" type="submit">Submit</button>
</form>
MikeOne is correct.
Add ngNoForm
to your form
<form ngNoForm method="post" action="http://other-server/">
<input name="something"
value="somevalue"/>
<button name="submit" type="submit">Submit</button>
</form>
You can do it like below:
<form #form action='http://other-server/' method='post'>
<input name="something"
value="somevalue"/>
<button type="submit" (click)="form.submit()">Submit</button>
</form>
I want to do a plain old form submit within my angular app, e.g. with this code:
<form method="post" action="http://other-server/">
<input name="something"
value="somevalue"/>
<button name="submit" type="submit">Submit</button>
</form>
So I put this into my components template, but nothing is submitted when I push the button.
The reason why I want this is because http://other-server/ does not send any Access-Control-Allow-Origin headers, so I cannot process the response in javascript.
I think you have to add ngNoForm to your form element. That prevents angular from trying to automatically consider the form to be an Angular form.
that’s nice, but so I have to use the submit button. I want tu submit it by javascript. So I put it into my index.html and operate with document.getElementbyID. As it is a hidden form, it’s ok.