What I would recommend in this case would be to use 2 separate functions. One for each% of% you need to do. This will give more freedom, including code reuse.
Getting more or less like this:
function http1() {
return $http.get('seu/caminho/arquivo.json').then(
function (response) {
outroHttp(response);
},
function (err) { alert('Alerta de erro'); }
);
};
function outroHttp(data) {
return $http.post('seu/caminho/arquivo.php', data).then(
function (response) {
//Seu tratamento de dados aqui
},
function (err) { alert('Alerta de erro'); }
);
};
In this way, you can call the function either through a function coming from the DOM:
<div ng-click="chamaHttp1()">Chama Função 01</div>
and no controller:
$scope.chamaHttp1 = http1();
Or reuse within the controller itself, following the same logic used in the $http
function.