Wit.AI
HTML
<form ng-controller="Ctrl" ng-submit="send()">
<input ng-model="phrase" />
<button type="submit">Submit</button>
</form>
<div>{{response}}</div>
CSS
textarea {
display: block;
}
JavaScript
angular.module('webplayer', [])
.controller('Ctrl', function($scope, $http) {
$scope.send = function() {
$http.jsonp('http://api.w' + 'it.ai/message', {
params: {
'access_token': 'XHKXNCJZOG6NMQ4WAUR23NNEE6KNJ3IU',
'q': $scope.phrase,
'callback': 'JSON_CALLBACK'
}
}).then(function(response) {
$scope.response = response.data;
});
}
});
angular.bootstrap(document.body, ['webplayer']);