I'm working on an application that requires a chat feature. It seems to work apart from the fact that in order for the chat message list to update, I have to perform an action for example type in the search box or click the "Send" button. The Chat receives messages through a websocket service (the service works fine). So it seems that the directory's DOM doesn't get updated before it is interacted with. I have also tried putting everything in without a directory and it still didn't work right.
I couldn't replicate this issue on JSFiddle (I couldn't include all of the code, but the base required for this to work is there).
I'm looking for ideas as to why this could be happening. Could this be an issue with event scopes? There are also WebsocketManagerService, P2PManagerService and ConnectionManagerService (this connects WS/P2P services) but I don't think it's relevant.
Sending a chat message:
EventManagerService.emit('chat message', 'some message');
Receiving a chat message:
EventManagerService.on(EventManagerService.EVENTS.RECEIVED_CHAT_MESSAGE, function (data) {
$scope.chatMessages.push({user: 'Client', message: data});
});