Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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"
  }
]