I want to create an AngularJS site that updates its information via websockets from the server. The server will emit a new chunk of information every second.
This is the code I have:
myApp.controller('mainController', function($scope) {
var connection = new WebSocket("ws:localhost:4080/", ['soap', 'xmpp']);
$scope.value= "null";
connection.onopen = function () {
connection.onmessage = function (e) {
$scope.value = e.data;
};
};
};