I've been facing a challenge with my app where I need to update the comments section whenever a comment is added, edited, or deleted without having to refresh the page. I am using ngResource to handle queries for both articles and comments (e.g.
$scope.articles = newsService.query()
).
Here's how my structure looks like:
ng-repeat="article in articles"
ng-repeat="comment in article.comments"
What would be a good practice or a general solution to ensure that the comments section of an article gets updated automatically when a new comment is made, modified, or removed?
Please note that each comment within article.comments contains references to specific comments, and each comment has a reference to an article.