Upon receiving JSON data on my webpage, I want to enable "like" and "dislike" options for buttons with a click event implemented through the code snippet below.
However, I am encountering difficulties in achieving the desired outcome and am unsure of how to properly iterate through the array.
// Implementation of like and dislike buttons
$scope.like = function(episode){
episode.cue.episode.ratings.loved =
(episode.cue.episode.ratings.loved) + 1;
if ((episode.cue.episode.ratings.hated) > 0)
episode.cue.episode.ratings.hated =
(episode.cue.episode.ratings.hated) - 1;
episode.liked = true;
episode.disliked = false;
};