如何提交以下位于角度组件内的表单?单击Send
按钮不会触发任何操作。
<form method="post" action="https://blub.shtml" id="form" name="form" target="_parent">
<input type="hidden" name="data" value="data" />
<input type="submit" value="Send" />
</form>
由于服务器的 CORS 策略,我无法使用(ngSubmit)
。
事实证明有
一种方法:不使用FormGroup
和ngNoForm
允许您通过单击按钮提交表单"non-ajax-way":
<form ngNoForm
method="post"
action="https://blub.shtml"
target="_parent"
>
<input type="hidden" name="data" value="{{data}}">
<input type="submit" value="Send" />
</form>