My question may seem bizarre, but I've built an angular SPA which allows a user to input information directly into a table using inputs. I did it this way as the data never needs to be submitted anywhere and is used by a service to calculate some values to be displayed at the end. My issue now though is I would like to validate the input to make sure they aren't empty.
I've done some research and all the tutorials I found relied on the input being part of a form, which I'm trying to avoid as the layout in the table looks fine and suits the purpose.
<table class="text-center">
<tr>
<th class="header">Course Type</th>
<th>Amount of Times</th>
<th>Frequency (PA)</th>
<th>% Staff who need it</th>
</tr>
<tr>
<td class="header"><label for="induction">Induction:</label></td>
<td><input class="form-control" type="number" id="inductionAmount" ng-model="staff.inductionAmount" /></td>
<td><input class="form-control" type="number" id="inductionFrequency" ng-model="staff.inductionFrequency" /></td>
<td><p>100</p></td>
</tr>
<tr>
<td class="header"><label for="newsLetter">News letter:</label></td>
<td><input class="form-control" type="number" id="newsLetterAmount" ng-model="staff.newsLetterAmount" /></td>
<td><input class="form-control" type="number" id="newsLetterFrequency" ng-model="staff.newsLetterFrequency" /></td>
<td><input class="form-control" type="number" id="newsLetterPercent" ng-model="staff.newsLetterPercent" /></td>
</tr>
</table>
<div class="row margin-top">
<div class="col-sm-4 col-sm-offset-4">
<button class="button-orange" style="font-size: 16px; font-weight: 700;" ng-click="clicked()">Next Step</button>
</div>
</div>
The information is stored in an object, which is later used to run some calculations for the user, what would be to recommended way to add some basic validation using angular 1.2 to not allow the user to continue if the values are empty? Sorry this is my first angular app. I've done JavaScript validation in the past using on blur etc, but it seems if I can use Angular it would be much simpler.