I am currently working on developing a social networking platform that includes an angular directive. This directive allows users to follow others by clicking on a button that appears next to their posts. The issue I am facing is that when I click on one follow button, the other buttons do not sync up and show the same result.
My main question is how can I synchronize all follow buttons?
This is how my code functions: A user's post displays with a like button at the bottom right corner. https://i.sstatic.net/N39xG.png
Upon clicking on the post, a modal pop-up window appears showing more details about the post, similar to clicking on an image in Facebook. https://i.sstatic.net/KOuHy.jpg
The problem arises when I attempt to vote (thumb up) in the modal pop-up, as it does not sync with the original thumb up button. https://i.sstatic.net/D36O8.jpg
Below is the code for voting:
VoteButtons.link = function (scope, ele, att) {
var post_id = att.voteButtons;
// Remaining code logic...