First I would like to add a little more context to the question.
Right now I have the following:
I want to make it more dynamic by removing the need to have a property in the class and just add a data property to the html element, in hopes that I can manage it's state using said property.
This whole idea might be wrong, so if there is another way to achieve this, please guide me into the right direction.
Thank you!
UPDATE
After some thinking I changed my approach a bit, instead of relying on the component property I added to each element a new [attr.data-visible] property with a default "false" value. Then on the mouseover event I added a method that gets the html element as a parameter and then changes the data-visible value from false to true, and vice versa on the mouseout event.
Here is a working StackBlitz
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…