Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Michael Williamson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Michael Williamson
Front End Web Development Techdegree Graduate 23,903 Points

using ng-repeat and ng-src together...

I am trying to pull an image location from each iteration over an array of objects and update each image's src attribute with each location so that 9 iterations creates a 9 divs each with image from the object it was created for

    <div class="items-container">
      <div class="item" ng-repeat="item in items">
        <img ng-src="">
      </div>
    </div><!---->

The array is items

[
  {"name":"Western & Co.",
   "model":"Billy Paycheck Signature",
   "image":"image/acoustic1.png"
  },
  {"name":"Blue Dawn",
   "model":"silhouette",
   "image":"image/acoutic2.jpg"
  },
  {"name":"Ridge Wood",
   "model":"shadow caster",
   "image":"image/acoustic1.png"

  },
  {"name":"Ridge Wood",
   "model":"creek",
   "image":"image/acoutic2.jpg"
  },
  {"name":"Blue Dawn",
   "model":"lost",
   "image":"image/acoustic1.png"
  },
  {"name":"Ridge Wood",
   "model":"Sally France Signature",
   "image":"image/acoustic1.png"
  },
  {"name":"Western & Co.",
   "model":"rattlesnake",
   "image":"image/acoutic2.jpg"
  },
  {"name":"Blue Dawn",
   "model":"Big Rock",
   "image":"image/acoutic2.jpg"
  },
  {"name":"Blue Dawn",
   "model":"Little Rock",
   "image":"image/acoustic1.png"
  }
]