I'm attempting to do a traditional form post into an iframe from within an Angular 4 app and it's simply posting into a new tab. I had trouble posting the form at all until I added ngNoForm
to the form element so I'm assuming that I need to do something else (maybe to the iframe element?) My form tag looks like:
<form
ngNoForm
method="POST"
action="http://some.url"
target="responseFrame"
>
My iframe tag looks like:
<iframe id="responseFrame" name="responseFrame" src=""></iframe>
Update: Take a look a look at this plunker. You will have to replace the demoEndpoint value with your desired endpoint in the component. The form action attribute in the template must also match your demoEndpoint. I tested this code with the only distinction of substituting my development endpoint with the demoEndpoint value and form action attribute value and it works correctly. https://plnkr.co/edit/NAJPfFyulzEQFtR01OML?p=info