I have an application developed using Ionic Framework , it is a hybrid application and in the tests done in the browser it worked perfectly, when I generated the .apk file and tested both the emulator and the device is not executing the request . the function that is generating error is:
$http.get('http://apps.widenet.com.br/busca-cep/api/cep.json?code='+cep)
.success(function(data, status, headers, config) {
if(data.status == 1){
$scope.respostas[0] = data;
}
else if (data.status == 0) {
$scope.hasErros = true;
$scope.erro = data.message;
}
})
.error(function(data, status, headers, config) {
$scope.hasErros = true;
$scope.erro = "Um erro inexperado ocorreu!";
});
}
})
This is the function that executes the request to the server, however it only falls in the part:
.error(function(data, status, headers, config) {
$scope.hasErros = true;
$scope.erro = "Um erro inexperado ocorreu!";
});