Currently, I find myself in a situation where I need to submit a form using the traditional method. This means that I am using a form with action="", and the response is streamed without reloading the page. While I understand that this approach is not typical for an AngularJS application, it is currently my only option.
In attempting to work around this limitation, I have tried populating some hidden fields using Angular:
<input type="hidden" name="someData" ng-model="data" /> {{data}}
It is worth noting that the correct value does appear in the data field.
The structure of the form is standard:
<form id="aaa" name="aaa" action="/reports/aaa.html" method="post">
...
<input type="submit" value="Export" />
</form>
However, when I submit the form, no value is sent to the server when using a hidden input field. Interestingly, changing the input field to type "text" results in the expected behavior. I suspect that the hidden field is not being properly populated unlike the text field, which benefits from two-way binding.
Does anyone have any suggestions on how I can successfully submit a hidden field populated by AngularJS?