I am implementing a chat module using angularJs, socketIo. (and nodeJS for backend).
In angular there is array attached to scope: $scope.messages. For a chat client all messages are pushed into this array, and this array is rendered in the view using ng-repeat.
<div class="chat-window">
<div class="chat-message" ng-repeat="message in messages track by $index">{{message}} </div>
</div>
However, when i push elements into 'messages' array, it is not getting rendered, unless there is a keypress or mouse event. I have checked and there no keypress or mouse event listeners. The view is somehow now getting updating automatically.
Can someone suggest me the problem?
$scope.$apply()after elements are pushed into the$scope.messagesarray.