Let's say we have component answer that has isOpen property. By default isOpen is false and when the user is clicking on the answer we are changing the isOpen to true.
We are showing the list of answers. How can we close the first answer when the user clicks on second answer?
I was thinking about creating a service answersSync with globalIsOpen = false.
I would suggest keeping track of which answer is open in your parent component, the one that lists the answers. Then your parent template would look something like:
(then have code in the parent component's js that keeps track of
currentlyOpenAnswer, responding to theopenAnsweraction)