I'm working on a project where I need to dynamically call pictures inside an ng-repeat loop. Initially, I tried adding a key/value pair of 'img' to the JSON object I'm fetching and then dropping it inside the URL. However, this approach did not work as expected. Here's an example of what I attempted:
<div ng-repeat="item in marketItemsTest | filter:searchPrivate">
<img src="assets/images/" + item.name + ".jpg" alt="img01"/>
I'm wondering if I'm not escaping this correctly or if it can't be done this way. Currently, I am only storing the name of the JPG file. Do you think I should store additional information instead?
Thank you for taking the time to read this!