title: Angular2 dynamic img src
body: <p>I have the following code:</p>
  
  <pre><code>&lt;a routerLink="/dashboard" routerLinkActive="active" #rla="routerLinkActive"&gt;
            &lt;img src="/assets/navigation/dashboard-icon-active.svg" /&gt;
          &lt;template [ngIf]="!isSmallSidebar"&gt;
            Dashboard
          &lt;/template&gt;
        &lt;/a&gt;
  </code></pre>
  
  <p>Running my app I see the image displayed correctly. However I want the image to change if the current route is active. So I did:</p>
  
  <pre><code>&lt;a routerLink="/dashboard" routerLinkActive="active" #rla="routerLinkActive"&gt;
          &lt;!-- &lt;img
            id="re-nav-dashboard-img"
            src={{ rla.isActive ? './assets/navigation/dashboard-icon-active.svg' : './assets/navigation/dashboard-icon.svg' }} /&gt; --&gt;
          &lt;template [ngIf]="!isSmallSidebar"&gt;
            Dashboard
          &lt;/template&gt;
        &lt;/a&gt;
  </code></pre>
  
  <p>This on the other hand results in:
  <a href="https://i.stack.imgur.com/5lQpZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5lQpZ.png" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong or is this a bug ?</p>