So I have some input text boxes in my html which I would like to send into my controller and add them to an object. What confuses me is how do I pass more than one value using only one ng-model. So far this is what I have in my html that reads out the number of inputs needed:
<div ng-repeat = "parameter in selectedMO.parameters">
<label> Value for {{parameter.name}} </label>
<input type="text" ngmodel="value"/>
</div>
Since I am using ng-repeat to add the necessary number of text boxes I only have one ng-model instead of different ones for every value.
angular.module('app.runBehaviorOper', [])
.controller('runBehaviorOper', [ 'discoveryService','$scope', '$route',
function( discoveryService, $scope, $route) {
//what should I do here in order to add each value inputted into
//an object in order to then be able to send it a function inside
//my discoveryService file
$scope.getBehaviorExec = function() { //this is called with the submit
// button in the html code
discoveryService.getBehaviorExec({
oid: $scope.oid,
parameters: //send parameters
});
};
}
]);
I am quite new to angularjs and the answers online have not worked so far for me.