How do I get the inputs from this form to go into an array in angular?
<form>
<tr>
<td class="Meal-form">
<input type="date" ng-model="date" placeholder="select" required></td>
<td>
<select ng-model="meal" ng-options="meals.name for meals in mealTypes">
<option value="" disabled selected>Select</option>
</select>
</td>
<td><input type="text" ng-model="about" placeholder="What did you eat" required></td>
<td>
<select ng-model= "feel" ng-options="feeling.name for feeling in feels">
<option value="" disabled selected>Select</option>
</select>
</td>
<td><input type="submit" id="submit" value="Submit Content"></td>
</tr>
</form>
I get how to pull the information from angular to HTML, but not how to get the HTML to angular.
$scope.journals = [ { date: '', meal: '', food: '', reaction: '' }]$scope.aboutand if for example on click of submit you want the data to be pushed into array, than just create something like$scope.addToList = function() {data = {id: 1, name : $scope.about, test: $scope.fell}; $scope.myList.push(data)}, bind this to your button via ng-click and this should work$scope.journals = [{date: $scope.date}], or whatever