So...I have literally scoured the internet looking for a solution to this problem and haven't found any answer that directly (or indirectly) suggests an answer.
I am trying to create multiple forms within a table with each row being wrapped in <form>
tags like so
<tr ng-repeat="item in items">
<form ng-submit="updateItem(item)">
<td ng-bind="$index + 1"></td>
<td ng-bind="item.title"></td>
<td><button>Submit</button></td>
</form>
</tr>
It seemed to work as intended until I realized that ng-repeat was not wrapping the <form>
tag around the <td>
tags and it ended up looking like so
<tr ng-repeat="item in items">
***<form ng-submit="updateItem(item)"></form>*** //The form tags were unwrapped
<td ng-bind="$index + 1"></td>
<td ng-bind="item.title"></td>
<td>
***<button>Submit</button>*** //Buttons don't submit cos no form
</td>
</tr>
whilst what I really want to achieve is something like
<tr>
<form>
<td>
<button>Hi</button>
</td>
</form>
</tr>
<tr>
<form>
<td>
<button>Hello</button>
</td>
</form>
</tr>
I would really love some help with how to deal with this.