title: AngularJS search by file's name
body: <p>I have a bunch of .svg files with different names in my img folder and a json file. One of json's value is similar to the name of .svg files. How can I go through all image files and all "cca2" so I could compare their names with json's value and if they match display the one in img tag? I'm doing my project with AngularJS.</p>
  
  <p>Example of json file:</p>
  
  <pre><code>[
      {
          "cca2": "AW"
      },
      {
          "cca2": "UA"
      },
      .....
  ]
  </code></pre>
  
  <p>Images: aw.svg, ua.svg etc.</p>
  
  <p>"AW", "UA" and etc. are values which I want to be compared with names of image files</p>
  
  <pre><code> for(var i = 0; i &lt; $scope.totalItems; i++){
          if($scope.countries[i].currency + "" === "UAH"){
              console.log("Good");
          }
      }
  </code></pre>
  
  <p>"UAH" needs to be replaced with all names of .svg files</p>
  
  <p>Structure of img folder:
  <a href="http://s18.postimg.org/8xvtnmzop/Untitled_1.jpg" rel="nofollow">http://s18.postimg.org/8xvtnmzop/Untitled_1.jpg</a></p>