Utilizing AngularJS to retrieve a JSON file:
{
"albumId": 1,
"id": 1,
"title": "accusamus beatae ad facilis cum similique qui sunt",
"url": "http://placehold.it/600/92c952",
"thumbnailUrl": "http://placehold.it/150/92c952"
},
and showcasing it with ng-repeat:
<div ng-repeat="image in images" class="col-xs-2 ">
<div class="thumbnail">
<img src="{{ image.thumbnailUrl }}" alt="" ng-click="open()" />
</div>
</div>
Everything is functioning smoothly. Next, I integrated ui.bootstrap to connect the thumbnails and trigger a modal window opening.
controller:
app.controller("page3Ctrl",['$scope', '$resource', '$uibModal', function ($scope, $resource,$uibModal) {
var postingsResource = $resource('http://jsonplaceholder.typicode.com/photos', {});
$scope.images = postingsResource.query();
$scope.open = function() {
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: 'modal.html'
});
};
}]);
Everything is working well. Now, the question arises - how can I dynamically display the corresponding image from thumbnailUrl in the modal URL? They need to match up.