Here's a situation with two input fields in a form that I need help with:
<form name="modifyApp" class="form-signin" ng-submit="modify(val)">
<input type="text" class="form-control" ng-model="val.name" id="appName">
<input type="number" class="form-control" ng-model="val.number" id="number" min="0" max="65535">
<button type="submit">Submit</button>
</form>
Upon loading the page, these fields are populated with values from the controller:
angular.module('myApp').controller('modifyAppController', ['$scope', function($scope) {
function setFields(appName, appNumber){
document.getElementById("appName").value = appName;
document.getElementById("number").value = appNumber;
}
$scope.modify= function(val){
console.log(val);
}
}])
The issue arises when clicking the Submit button. The values are not being registered unless they are manually changed beforehand. For instance, upon hitting the Submit button without any changes, nothing is printed to console. However, modifying either the number or the name results in the value being displayed.