This is my html.
<div class="pull">
<select name="ifield06" ng-model="selectCuenta" ng-options="cuentas as cuentas.asociado for cuentas in ListaCuentas track by cuentas.id ">
<option value="">Cuenta</option>
<option value="">Cuenta1</option>
<option value="">Cuenta2</option>
</select>
</div>
This is how I get the list in my service:
this.getCuentas = function () {
return $http.get(UrlCuentas);
};
I consume it in my controler in the following way
$scope.status='';
$scope.selectCuenta =null;
productoServicio.getCuentas().then(function (response) {
$scope.ListaCuentas = response.data;
//$scope.estado = true;
}, function (error) {
$scope.status = 'Unable to load customer data: ' + error.message;
// $scope.estado = false;
});
I need to call a JSON (ex: UrlRecibos) when for example I select "account1" this does not know where to do it if in the service or controller of my Angular application.
I had thought to do it with a ng-click
but I do not know how to implement the function. Please someone who can help me I'm new to AngularJS.