I'm stuck with my mini project, I have a feeling it's something trivial...
I am trying to bind websocket messages to angular datamodel. I don't seem to be able to do that...
Below my controller and a little bit of html to display the data.
controllers.WebsocketController = mainModule.controller('WebsocketController', function($scope){
$scope.test = 'test string';
var socket = new SockJS('/dashboard');
stompClient = Stomp.over(socket);
stompClient.connect({}, function(frame) {
setConnected(true);
console.log('Connected: ' + frame);
stompClient.subscribe('/topic/dashboardEntries', function(message){
$scope.dashboardEntries = message.body;
});
});
})
That's what I'm using to display the data:
<div id="dateDiv" class="container" ng-controller="WebsocketController">
<p id="response"> {{dashboardEntries}} </p>
<p id="response1"> {{test}} </p>
</div>
I cannot seem to understand why the test data object is displayed and the dashboard entries are not... I debugged my code and I am getting these messages - also I was able to populate that paragraph using jQuery, but data binding does not seem to work...