I am looking for a solution related to the following question/answer:
How can I cycle through JSON objects one by one in AngularJS on click
I need help with a function that displays the previous item from a JSON object. When the first item is selected, clicking should display the last item. I attempted to modify the code like this:
$scope.current = 0;
$scope.Back = function() {
$scope.current = ($scope.current - 1) % $scope.data.length;
};
However, when the first item is selected and I click on it, nothing happens. How should I modify this function to include a 'back-function'?