json - AngularJS search by file's name -
i have bunch of .svg files different names in img folder , json file. 1 of json's value similar name of .svg files. how can go through image files , "cca2" compare names json's value , if match display 1 in img tag? i'm doing project angularjs.
example of json file:
[ { "cca2": "aw" }, { "cca2": "ua" }, ..... ]
images: aw.svg, ua.svg etc.
"aw", "ua" , etc. values want compared names of image files
for(var = 0; < $scope.totalitems; i++){ if($scope.countries[i].currency + "" === "uah"){ console.log("good"); } }
"uah" needs replaced names of .svg files
structure of img folder: http://s18.postimg.org/8xvtnmzop/untitled_1.jpg
Comments
Post a Comment