I'm setting up a gallery view for a local house builder using bootstrap and Angularjs 1.5X. For the gallery view I want to show a list of thumbnail images down one side, and then the full image on the other. My problem is that I am trying to call the images in an array, that are also inside of another array within that first array, like so.
app.controller('ImageController', function () {
this.images = gallerys;
});
app.controller('GalleryController', function () {
this.current = 0;
this.setCurrent = function (newGallery) {
this.current = newGallery || 0;
};
});
var gallerys = [{
images: [
{
full: 'img/gallery/monson/monson_full_01.JPG',
thumb: 'img/gallery/monson/thumbnail/monson_thumb_01.JPG'
},
{
full: 'img/gallery/monson/monson_full_02.JPG',
thumb: 'img/gallery/monson/thumbnail/monson_thumb_02.JPG'
}]
},{
images: [
{
full: 'img/gallery/monson/monson_full_01.JPG',
thumb: 'img/gallery/monson/thumbnail/monson_thumb_01.JPG'
},
{
full: 'img/gallery/monson/monson_full_02.JPG',
thumb: 'img/gallery/monson/thumbnail/monson_thumb_02.JPG'
},
I want to just repeat through all the thumb images in the first images array.I want to use each images array on a different page.This is what my code looks like in the HTML view.
<div class="content" ng-controller="ImageController as image">
<div class="col-md-8">
<div ng-controller="GalleryController as gallery">
<div ng-repeat="image in image.images">
<img class="img-full || img-responsive" ng-src="{{image.images[gallery.current].full}}">
</div>
</div>
</div>
<div class="col-md-4">
<ul class="img-thumb" ng-controller="GalleryController as gallery">
<li ng-repeat="image in image.images">
<img ng-src="{{image.images[0].thumb}}">
</li>
</ul>
</div>
</div>
I have a demo of this site up if that helps anyone. http://demo.ranlife.com/beaconhomes2/monson.php