I've hit a roadblock with my mini project, and I have a hunch it's something simple...
My challenge is binding websocket messages to an Angular datamodel, but I can't seem to make it work...
Here is my controller and some 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;
});
});
})
This is how I'm displaying the data:
<div id="dateDiv" class="container" ng-controller="WebsocketController"><br/>
<p id="response"> {{dashboardEntries}} </p><br/>
<p id="response1"> {{test}} </p><br/>
</div>
I'm puzzled as to why the test data object shows up but not the dashboard entries. I've checked my code, received the messages, and even managed to populate the paragraph using jQuery - yet the data binding just won't cooperate...