title: Reloading image in javascript without any parameter-hack
body: <p>I am trying to display an image and automatically refresh it every minute using AngularJS.</p>
  
  <p>The problem is that the image I am grabbing is from an API that won't allow me to append any bogus stuff to the url to make the url different each time. So, no <code>?_ts=12356678</code> and so on...</p>
  
  <p>The current code I have is something like this:</p>
  
  <p>HTML template:</p>
  
  <pre><code>&lt;div data-ng-controller="UpdateController" data-ng-init="image_reloader(timer=2000, url='http://lorempixel.com/400/200/sports/')"&gt;
    &lt;img ng-src="{{ image_url }}"&gt;&lt;/img&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>AngularJS Javascript:</p>
  
  <pre><code>var app = angular.module('app', []);
  app.controller('UpdateController', function($scope, $timeout) {
    $scope.image_reloader = function(timer, url) {
      $scope.timer = timer || 10000;
      $scope.updater = function() {
        $scope.image_url = url + '?_ts=' + new Date().getTime();
        $timeout($scope.updater, $scope.timer);
      };
      $scope.updater();
    };
  });
  </code></pre>
  
  <p>This kind of does the trick, except for the <code>?_ts</code> part which I can't use... Changing the <code>scope.image_url</code> part to <code>$scope.image_url = url;</code> doesn't do anything, it does not try to refresh the image either.</p>
  
  <p>How can I force AngularJS to try to refresh it? I've also tried to set <code>$scope.image_url</code> to <code>''</code> before changing it to url.</p>
  
  <p>AngularJS is just the framework, any Javascript/jQuery solution would do, but I prefer an AngularJS-related one.</p>