title: Load image from C# Byte array and place image in html tag using AngularJS
body: <p>I'm having an Image in the form of Byte Array, from that I'm converting Byte Array from the following C# method</p>
  
  <pre><code>public HttpResponseMessage ReturnBytes(byte[] bytes)
  {
    HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
    result.Content = new ByteArrayContent(bytes);
    result.Content.Headers.ContentType = 
        new MediaTypeHeaderValue("application/octet-stream");
  
    return result;
  }
  </code></pre>
  
  <p>My HTML Source Code:</p>
  
  <pre><code>&lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
  
  &lt;div id="div_image"&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;
  var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope, $http) {
      $http.get("someurl")
      .then(function(response) {
          $scope.imageSrc = response.data;
          $('.div_image').html('&lt;img src="data:image/png;base64,' + $scope.imageSrc + '" /&gt;');
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Reference Links I have followed :</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/23884182/how-to-get-byte-array-properly-from-an-web-api-method-in-c">How to Get byte array properly from an Web Api Method in C#?</a></li>
  <li><a href="https://stackoverflow.com/questions/10802312/display-png-image-as-response-to-jquery-ajax-request">Display png image as response to jQuery ajax request</a></li>
  </ul>
  
  <p>I Can't able to load the image in the HTML View. Kindly assist me...</p>