Hi Sebastian, Couple of suggestions: Is auto-reload really necessary? This scenario looks more feasible for banking, stocks and real-time communication. Alternative could be synching the user POSTS data on navigation or some action/ operation in a view.
I am not sure about the data layer, however It's weird that the $scope.comments is always updated. Try angular.equals(responseCommentsEntity, scopeCommmentsEntity) before updating the $scope.comments. Images blink could be resolved by adding a CSS loader between REST request and success call. Regards Rishi On Fri, Mar 27, 2015 at 8:51 PM, Sebastian G <[email protected]> wrote: > Heys guys, > > I have the following question. > We have got a comment system on every post we make with unique comment to > this post like youtube for every video. We of course want the comments > always to be up to date without refreshing the page. > When loading the page we make a call to our API which then gives us all > comments as JSON response. Then we just do a ngrepeat onto this response to > load the comments. > We have setup a interval to reload those comments from our api. > Before saving the response to the scope we check if the json response is > the same like the current json response which is already saved. > But it seems to replace it always also when the content is the same. > Furthermore which is more important we dont want that our user see that > the comments where reloaded. Is there a nicer way to do this because they > always see that the $scope.comments was replaced because the > images blink once of course. > > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
