title: Angular 2 - render byte[] from Web Api as an image src
body: <p>I have an Angular 2 app that is connecting to a Web Api backend.
  There is an endpoint that returns a byte[] of an image that is stored in a sql database.
  How can I display this as an image in Angular? 
  I can change either the Web Api or Angular app.</p>
  
  <p>My Web Api endpoint looks like this...</p>
  
  <pre class="lang-c# prettyprint-override"><code>[Route("api/profileimage/{userId}")]
  public byte[] Get(string userId)
  {
      var image = _profileImageService.GetProfileImage(userId);
  
      return image;
  }
  </code></pre>
  
  <p>And my Angular HTML looks like this...</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;img src="http://localhost:2116/api/ProfileImage/{{tile.UserId}}" width="100" height="100"/&gt;
  </code></pre>
  
  <p>What conversion do I need to do, or what should the api serve up?</p>