Angular $http get watch an api for data changes
<p>I am using DRF and AngularJS for my website. I make a simple request like-</p>

<pre><code>$http({
method: "GET",
url: "http://127.0.0.1:8000/api/sendeop",
  }).then(function success(response) {

    //some processing on the data returned

}, function error(response) {});
</code></pre>

<p>Now if data changes in the database, it is not reflected on angularJS as this only makes the request once while it loads. How to watch the api for data change and process it in angularJS?</p>

<p>I'm not quite sure if <code>$watch</code> or <code>$digest</code> solve my problem, but if they do, how do I use them?</p>