I have this HTML code:
<li data-thumb="images/ss.jpg">
<img src="images/ss.jpg"/>
</li>
<li data-thumb="images/ss1.jpg">
<img src="images/ss1.jpg"/>
</li>
<li data-thumb="images/ss2.jpg">
<img src="images/ss2.jpg"/>
</li>
<li data-thumb="images/ss3.jpg">
<img src="images/ss3.jpg"/>
</li>
And I wish to use my angularJS controller in order to create something like this in my HTML instead:
<li data-thumb="{{image[i].src[i]}}" ng-repeat="image in images">
<img ng-src="{{image[i].src]i]}}"/>
</li>
(I know the above code doesn't work, that is why I am asking...)
So essentially I will have the same output as before (4 different images). My "ListingCtrl" controller so far has this:
$scope.images = [{
src1: 'images/ss.jpg',
src2: 'images/ss1.jpg',
src3: 'images/ss2.jpg',
src4: 'images/ss3.jpg',
}];
I will appreciate any help in making me accomplish this! In the future I want to parse a JSON file there and get the images from that instead... But I guess this should be a start.