I would like to get my value from select ng-model="NumProdutos[$index]" if I click in the button.
The possibles values in this select is '1, 2, 3' and this select is inside a div with a ng-repeat
Here its my html code:
<select class="form-control"
style="max-width:55%;"
ng-model="NumProdutos[$index]"
ng-options="obj.NumProdutos as obj.NumProdutos for obj in NumeroProdutos"
ng-change="functionnumprodutos(NumProdutos[$index], {{x[0].NumPostoAgendamento}})"></select>
<input type="submit" value="teste" ng-click="teste($index)" class="btn btn-primary" />
Controller
$scope.teste = function (a) {
console.log('a: ', a);
console.log('N NumProdutos: ', $scope.NumProdutos[a]);
console.log('N NumProdutos: ', $scope.NumProdutos);
console.log('N NumProdutos: ', $scope.NumProdutos[$index]);
}
I tried console.log, but I didn't know how to get this values of ng-model="NumProdutos[$index]"