2

I have this JSON

{
    "Industrial Visits to L&T Construction Equipment Limited":
        [
            "1467970539_789007_2014.jpg",
            "1467970539_644015.jpg",
            "1467970539_238317.png",
            "1467970539_946963.png"
        ],
    "Industrial Visits to Titan":
        [
            "1467968484_995138.png",
            "1467968226_987063.jpg",
            "1467968226_210302.jpg",
            "1467969523_721853.jpg"
        ]
}

I have to print title and its related images under that title on an HTML page.

I'm doing this:

<div ng-repeat="item in indusvisitlist">
                    <div ng-repeat="(key, value) in item">
                        <h3>{{key}}</h3>
                        <p class="col-md-6 col-sm-6" ng-repeat="image in value">
                            <img src="files/{{image}}" class="img-responsive img-thumbnail" />
                        </p>
                    </div>
                </div>

I found this solution on another Stack overflow question. But it is not printing anything but 0 1 2 3 0 1 2 3

Can somebody please figure out where the problem might be. Thanks.

1
  • 1
    Make it ng-src as you have bindings there Commented Jul 26, 2016 at 4:33

1 Answer 1

1

maybe you should try:

<div ng-repeat="(key, value) in indusvisitlist">
   <h3>{{key}}</h3>
   <p class="col-md-6 col-sm-6" ng-repeat="image in value">
     <img ng-src="files/{{image}}" class="img-responsive img-thumbnail" />
   </p>
</div>
Sign up to request clarification or add additional context in comments.

2 Comments

Use ng-src while you have bindings in urls
@ShintuJoseph: you are right... edited the code above :)

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.