title: How to return image from $http.get in AngularJS
body: <p>In my controller I call a service that returns a promise  </p>
  
  <pre><code>var onComplete = function(data) {
                 $scope.myImage = data;           
              };
  </code></pre>
  
  <p>In my service I make a call to get the image by passing url directly to the image itself:</p>
  
  <pre><code>   return $http.get("http://someurl.com/someimagepath")
           .then(function(response){          
            return response.data;
           });
  </code></pre>
  
  <p>All the calls are succeeding and the response.data appears to be holding in an image inside:</p>
  
  <pre><code>����JFIF��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 90
  ��C
  
  
  
  
  ��C      
  
  ����"�� 
  ���}!1AQa"q2���#B��R��$
  </code></pre>
  
  <p>although I'm not sure if it actually does because I'm having trouble displaying it. I've tried (inside index.html)</p>
  
  <pre><code> &lt;img ng-src="{{myImage}}"&gt; 
    and
  &lt;img ng-src="{{myImage}}.jpeg"&gt; 
    and   
   &lt;img ng-src="data:image/JPEG;base64,{{myImage}}"&gt;
  </code></pre>
  
  <p>Ideas?
  Is it possible to return an actual image from $http.get and convert its response back to image (jpeg, etc.)</p>
  
  <p>Thanks!</p>