Demo.JS
angular.module('PubNubAngularApp', ["pubnub.angular.service"])
.controller('MySpeechCtrl', function($rootScope, $scope, Pubnub) {
$scope.theText = "Don't just stand there, say something!";
$scope.dictateIt = function () {
$scope.theText = "";
var recognition = new webkitSpeechRecognition();
recognition.onresult = function (event) {
$scope.$apply(function() {
for (var i = event.resultIndex; i < event.results.length; i++) {
if (event.results[i].isFinal) {
$scope.theText += event.results[i][0].transcript;
}
}
});
};
recognition.start();
};
});
Link to codepen.io demo
Here is the complete package for you.