List not refreshed in a Real time twitter timeline


#1

Hello,

I’m developping a real-time Twitter timeline in a Ionic App.
I receive a stream of tweets from my server (Server Sent Events).
I have a list linked to an array (ng-repeat). Everytime I receive a tweet, I push it in the array.
The problem is that the view doesn’t refresh. I need to open the sidemenu to refresh it.
I tried with ng-collection but it doesn’t work.

Thanks for your help !

Here is parts of my code : https://gist.github.com/Guiguillermo/15558705c2b02646b18b


#2

Total guess but i think this is in a call back external to angular, to support binding angular needs to know everytime something happens that might update the scope.

Try adding

$scope.$apply(function() {
    $scope.tweetStream.unshift(angular.fromJson(e.data))	
});