title: Conditional Image Src Binding in angular 2
body: <p>How to write the ternany condition for <code>&lt;img&gt;</code> <code>src</code> in Angular 2.</p>
  
  <p>Below is the code I tried but this is not working</p>
  
  <pre><code>&lt;img class="lib-img" [src]="item.pictureUrl!= null ? item.pictureUrl : ~/images/logo.png" height="500" width="500" alt="default image"&gt;
  </code></pre>