the block displays the value from the database. After selecting the value I want to pull out the id.
<div class="block">
<label>Refer</label>
<select ng-controller="selectRefer">
<option ng-repeat="ref in refer">{{ref.refer}}</option>
</select>
<button ng-click="MyFunction()"> - </button> //тут я бы хотел
через ng-click изьять
//данные из тега select и передать в
//контроллер и
</div>
Controller
selectInfo.controller('selectRefer', ['$scope', '$http',
function ( $scope, $http) {
$http({
method: 'get',
url: 'mysite',
}).then(function successCallback(response) {
// Store response data
$scope.refer = response.data;
$scope.id = response.id
});
}]);
How to get the id out of the options tag by clicking on the button - I don’t understand something.