There seems to be an issue with the script not running or returning any answers. The console is blank. I am attempting to retrieve an answer from the Yandex Translate site (https://tech.yandex.com/translate/doc/dg/reference/translate-docpage/) Code: http://jsbin.com/jolijep/edit?html,js,console,output
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() {
// Data to be sent
var textApi = 'Hello';
var langApi = 'en-ru';
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;
});
};
});
<!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>