I have a mobile app I have a form
that does a filter by districts and counties what happens and is not redeeming the data selected at home select
the triggered button does nothing.
Controller
.controller('FiltraEstabelecimentos', function($scope, $http, $stateParams) {
$scope.BtnFiltraCat= function (campo){
$http.post("https://www.sabeonde.pt/api/api_filtra_estabelecimentos.php?distrito=" + campo.distrito + "&concelho=" + campo.concelho + "&categoria=" +$stateParams.catSlug).success(function (data) {
$scope.filtra_estabelecimentos = data;
});
};
})
View
<div ng-controller="FiltraEstabelecimentos">
<form>
<div class="row">
<div class="col">
<label ng-controller="ListaDistritos" style="border-radius: 10px; margin: 0px 0px 10px 0px;" class="item item-input item-select">
<div class="input-label">
Distrito
</div>
<select ng-model="campo.distrito">
<option ng-repeat="lista_distritos in distritos" value="{{lista_distritos.id}}">{{lista_distritos.titulo}}</option>
</select>
</label>
<label ng-controller="ListaConcelhos" style="border-radius: 10px;" class="item item-input item-select">
<div class="input-label">
Concelho
</div>
<select style="border-radius: 10px;" ng-model="campo.concelho">
<option ng-repeat="lista_concelhos in concelhos" value="{{lista_concelhos.titulo}}">{{lista_concelhos.titulo}}</option>
</select>
</label>
</div>
</div>
<div style="margin:0px 10px 0px 10px;">
<button type="submit" ng-click="BtnFiltraCat(campo);" style="background-color: #CA5B60; border:#CA5B60; border-radius: 10px;" class="button button-block button-positive">
<i class="ion-search"></i> Pesquisar
</button>
</div>
</form>
</div>