title: How can I add images on the Angular 2/4 material design select component
body: <p>I'm using the <a href="https://material.angular.io/components/select/overview" rel="nofollow noreferrer">material angular select component</a>. I can see the icons when I click on the selector but the problem is when I choose an option it only shows the value and not the icons.</p>
  
  <p>At the moment the code is rewriting the <code>&lt;md-option&gt;</code> removing the <code>&lt;img&gt;</code> tag and adding the <code>{{bodyStyle.viewValue}}</code></p>
  
  <p><strong>app.component.html</strong></p>
  
  <pre><code>&lt;div class="form-control form-control--center"&gt;                 
   &lt;md-select [(ngModel)]="selectedBodystyle" floatPlaceholder="never" name="bodyStyle"&gt;
      &lt;md-option *ngFor="let bodyStyle of bodyStyles" [value]="bodyStyle.value"&gt;
          &lt;img src="{{bodyStyle.icon}}" alt="{{bodyStyle.viewValue}}"&gt;
              {{bodyStyle.viewValue}}
  
      &lt;/md-option&gt;
   &lt;/md-select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>  selectedBodystyle: string;
    bodyStyles = [
      { value: 'Mercedez' , viewValue: 'Mercedez', icon: "http://lorempixel.com/50/50/transport/" },
      { value: 'Ferrari'  , viewValue: 'Ferrari' , icon: "http://lorempixel.com/50/50/transport/" },
      { value: 'BMW'      , viewValue: 'BMW'     , icon: "http://lorempixel.com/50/50/transport/" }
    ];
  </code></pre>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I tried to add the image in the <code>viewValue</code> attribute like</p>
  
  <pre><code>{ value: 'Ferrari'  , viewValue: '&lt;img src="http://lorempixel.com/50/50/transport/" alt="Ferrari"&gt;Ferrari' }
  </code></pre>
  
  <p>but it loads the html in plain text it doesn't show the image after being selected</p>
  
  <p>This is what it shows after select an option it removes the image it shows only the only the content from the <code>viewValue</code></p>
  
  <p><a href="https://i.stack.imgur.com/FfA4K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FfA4K.png" alt="enter image description here"></a></p>