title: Load only images using filename in the img tag alt attribute using AngularJS
body: <p>I am using AngularJS and trying to load only images from variety of files in my img tag.</p>
  
  <p>Here I can get file names as ex1.jpg, ex2.png, ex3.txt, ex4.pdf etc. What I want to do is I will load the filename in my alt attribute of my img tag like</p>
  
  <pre><code>&lt;img ng-src="http://localhost:9080/si-dev/binaryServlet?id=NDp3YXRlcjEuanBn" alt="ex1.jpg" ng-click="showPhoto1($index);" src="http://localhost:9080/si-dev/binaryServlet?id=NDp3YXRlcjEuanBn"&gt;
  </code></pre>
  
  <p>and also like</p>
  
  <pre><code>&lt;img ng-src="http://localhost:9080/si-dev/binaryServlet?id=NDp3YXRlcjEuanBn" alt="ex3.txt" ng-click="showPhoto1($index);" src="http://localhost:9080/si-dev/binaryServlet?id=NDp3YXRlcjEuanBn"&gt;
  </code></pre>
  
  <p>I want load only images in my img tags using the filename extension in alt attribute.</p>
  
  <p>If filename contains .jpg or .png only load the url into ng-src.</p>
  
  <p>Is there anyway to do this in angular like ng-if etc?</p>
  
  <p>Thanks</p>