title: ng-repeat - detecting if image exists and handling
body: <p>I am displaying some images in my view using:</p>
  
  <pre><code>&lt;div class="post" ng-repeat="post in vm.posts"&gt;
    &lt;a href="{{post.url}}" target="_blank"&gt;
      &lt;img ng-src="/feed/{{post.image}}.jpg" /&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>but the <code>vm.posts.image</code> will be empty on occasions. At the moment the icon for an incorrect image src is displaying in the browser when the value is empty but I would just prefer to show a black space.</p>
  
  <p><strong>Update:</strong>
  I've managed to make it work using <code>ng-if</code> (shown below) - is there a way to do this within the ng-src tag?</p>
  
  <pre><code>&lt;div ng-if="post.image"&gt;
  
  &lt;/div&gt;
  </code></pre>