javascript - Angular array not updating view -



javascript - Angular array not updating view -

i implementing chat module using angularjs, socketio. (and nodejs backend).

in angular there array attached scope: $scope.messages. chat client messages pushed array, , array rendered in view using ng-repeat.

<div class="chat-window"> <div class="chat-message" ng-repeat="message in messages track $index">{{message}} </div> </div>

however, when force elements 'messages' array, not getting rendered, unless there keypress or mouse event. have checked , there no keypress or mouse event listeners. view somehow getting updating automatically.

can suggest me problem?

i think have force info using ajax.

jquery ajax out of capability of angular, need wrap below, tell $scope.message going update , update view also..

after force info seek applying...

$scope.$apply(function(){ $scope.message= data; });

javascript arrays angularjs socket.io chat

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -