As I delve into expanding my knowledge in AngularJS, I've encountered some issues while trying to run code on Plunker.
Could someone take a look at the code and point out what I might be doing incorrectly? The code snippet is provided below:
var app = angular.module('plunker', [])
.controller('AlbumCtrl', function($scope) {
$scope.images = [
{category : 'High', image : 'http://lorempixel.com/g/850/400', description : 'Random Photo', stars : '4/5'},
{category : 'Medium', image : 'http://lorempixel.com/g/850/400/sports', description : 'Sports Photo', stars : '3/5'},
{category : 'Medium', image : 'http://lorempixel.com/g/850/400/animals', description : 'Animal Photo', stars : '3/5'},
{category : 'High', image : 'http://lorempixel.com/g/850/400/abstract', description : 'Abstract Photo', stars : '5/5'},
{category : 'Low', image : 'http://lorempixel.com/g/850/400/business', description : 'Business Photo', stars : '1/5'},
{category : 'High', image : 'http://lorempixel.com/g/850/400/cats', description : 'Cat Photo', stars : '4/5'},
{category : 'Medium', image : 'http://lorempixel.com/g/850/400/city', description : 'City Photo', stars : '3/5'},
{category : 'Low', image : 'http://lorempixel.com/g/850/400/fashion', description : 'Fashion Photo', stars : '2/5'},
{category : 'High', image : 'http://lorempixel.com/g/850/400/nature', description : 'Nature Photo', stars : '5/5'}
];
$scope.currentImage = _.first($scope.images);
$scope.imageCategories = _.uniq(_.pluck($scope.images, 'category'));
$scope.setCurrentImage = function(image) {
$scope.currentImage = image;
};
});
http://plnkr.co/edit/6KcKvxHR9mZitFL6eidX?p=preview
I would greatly appreciate any assistance with getting this code up and running. Additionally, once it's functioning properly, I'm looking to enhance it by adding an arrow selector for scrolling through images and changing the main image, as well as implementing a zoom icon for the main image to enable fullscreen viewing. If needed, I'll create a separate query for that.
Your help on this matter would be invaluable.