The following code snippet is located inside the controller:
var client = new Faye.Client('http://localhost:9292/faye');
client.subscribe('/main', function(message) {
console.log(message);
$scope.messages.push(message);
console.log($scope.messages);
});
In this scenario, I am utilizing Faye to monitor a channel and then adding an object to $scope
. Despite successfully adding the message
object to scope and viewing it through console.log
, the DOM
remains unrefreshed and Two-Way binding fails to take effect.
I'm seeking guidance on resolving this issue. How can I address the lack of DOM refresh and ensure successful Two-Way binding?