0

I am trying to make the li's repeat for each image in the image array. Using the variable image as my identifier identifier but for some reason I am not able to loop through the array. I am making adjustments in the following line:

<li class="small-image pull-left thumbnail" ng-repeat="product in store.products.images" >

Please refer to the Plunker for the code.Here is my Plunker

4
  • It's working :-) plnkr.co/edit/5WWtdSgLpDLk5OrDa3aX?p=preview Commented Mar 1, 2015 at 5:00
  • Thanks, could you tell me why does this thing doesn't work <li class="small-image pull-left thumbnail" ng-repeat="image in product.images"> <img ng-src="{{image}}" /> </li> ?( I updated the plunker) Commented Mar 1, 2015 at 5:08
  • Yes,Simple you are binding products with "this" which is controller not $scope therefore you cannot access product.images directly you need a object of controller which is store as you created in "StoreController as store" Commented Mar 1, 2015 at 5:12
  • @NewDev i deleted the answer :) Commented Mar 1, 2015 at 5:26

1 Answer 1

1

I just updated head part in your HTML in plunker to

<head>
    <script data-require="[email protected]" data-semver="1.4.0-beta.5" src="https://code.angularjs.org/1.4.0-beta.5/angular.js"></script>
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css" />

    <script type="text/javascript" src="app.js"></script>
  </head>

angular.min.js was faulty

Sign up to request clarification or add additional context in comments.

3 Comments

So there is no problem in it :-P
hehe you should add it by default on the behalf of OP:-p
who is OP called? is it something stack overflow slang?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.