2

How to display all the images in the form of grid, which all will come from back end, so the images are in the dynamic form. and I have to put Description as well on those images, and those Description are also coming from Back End in AngularJS?

1
  • Can you give example of what you have tried? Commented Feb 6, 2017 at 10:59

2 Answers 2

4

If image data is coming in array then you can show image using ng-repeat directive.

Controller

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.imageList = allImage;
});

HTML

<div class="col-md-3" ng-repeat="image in imageList track by $index">
    <img src="{{image.imageUrl}}" />
    <label> {{image.description}} </label>
</div>
Sign up to request clarification or add additional context in comments.

Comments

1

You can use ng-repeat for showing you image with description like:

<li class="col-sm-3" ng-repeat="product in productList">
                        <img src={{product.imageUrl}} />
                        <label>{{product.description}}</label>
                    </li>

Here is the documentation

Comments

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.