<form ng-submit="send_ticket()">
<div class="modal-body">
<div class="form-group">
<label for="ticketSubject">Тема</label>
<input class="form-control" type="text" ng-model="ticketData.subject" required id="ticketSubject">
</div>
<div class="form-group" ng-controller="ServicesCtrl">
<label for="ticketService">Услуга</label>
<select class="form-control" ng-model="ticketData.service" id="ticketService" ng-options="opt as opt.id for opt in services">
<option value="">Выберите услугу</option>
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" ng-click="cancel()">Закрыть</button>
<button type="submit" class="btn btn-primary">Отправить</button>
</div>
</form>
controller('ServicesCtrl', function($scope, $http) {
$http.get('/links/services')
.success(function(data) {
$scope.services = data;
});
})
[
{"id": "1", "desc": "Описание", "date": "Дата", "status": "success"},
{"id": "2", "desc": "Описание", "date": "Дата", "status": "success"},
{"id": "3", "desc": "Описание", "date": "Дата", "status": "success"},
{"id": "4", "desc": "Описание", "date": "Дата", "status": "success"},
{"id": "5", "desc": "Описание", "date": "Дата", "status": "success"}
]
$scope.send_ticket = function() {
$http.post('http://example.com/example.php', $scope.ticketData)
};
В форму отправляется все значения элемента, как отправить только id?