title: AngularJS - display image from bytes
body: <p>In my AngularJS webapp I need to load an image from a file and then display it.
  But it doesn't work.</p>
  
  <p>My plunk is: <a href="http://plnkr.co/edit/gpwyUd3Hh6HvrBnt2dR6" rel="nofollow">http://plnkr.co/edit/gpwyUd3Hh6HvrBnt2dR6</a></p>
  
  <p>My JavaScript is:</p>
  
  <pre><code>var test = function() {
  var getImgBytes = function() {
      return $http({    url: 'Spa_03.jpg', 
                        method: 'GET', 
                        headers: {'Content-Type': 'image/jpeg'}})
      .then(
        function(result) {
          console.log('load img from file');
          $scope.imgTest = result.data;
      });
    }();
  $scope.height = 853;
  $scope.width = 1280;   }();
  </code></pre>
  
  <p>My HTML is:</p>
  
  <pre><code>&lt;img ng-src="data:image/JPEG,{{imgTest}}" width="320px" height="213px"/&gt;
  </code></pre>
  
  <p>Could someone help me to fix the problem ?</p>
  
  <p>Regards.</p>