Вот с кнопкой. Делаю в jsbin
jsbin
Бестолку.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="weather.js"></script>
</head>
<body ng-app="jsbin">
<div ng-controller="DemoCtrl as vm">
<script src="weather.js"></script>
<button ng-click="SendData()">Send</button>
<br>
Data: {{PostDataResponse}}<br>
{{vm.data}}
{{vm.PostDataResponse}}
Data: {{scope.PostDataResponse}}
{{vm.data}}
</div>
</body>
</html>
var app = angular.module('jsbin', []);
app.controller('DemoCtrl',function($scope, $http){
var url = "https://translate.yandex.net/api/v1.5/tr.json/translate",
keyAPI = "trnsl.1.1.20130922T110455Z.4a9208e68c61a760.f819c1db302ba637c2bea1befa4db9f784e9fbb8";
var vm = this;
$scope.SendData = function () {
// тут данные
var textApi='Hello';
var langApi='en-ru';
var text1='Hello';
var data = "key="+keyAPI+"&text="+textApi+"&lang="+langApi;
$http.post(url, data)
.success(function (data, status, headers, config) {
vm.data = response.data;
$scope.PostDataResponse = data;
console.log(data);
})
.error(function (data, status, header, config) {
$scope.ResponseDetails = "Data: " + data +
"<hr />status: " + status +
"<hr />headers: " + header +
"<hr />config: " + config;
});
};
});