I have created a custom Directive called isSelected and applied it to several elements in different components as shown below:
<i isSelected class="icon"></i>
<i isSelected class="icon"></i>
<i isSelected class="icon"></i>
<i isSelected class="icon"></i>
Now, I am trying to figure out how to access the elements that have the 'isSelected' Directive within the Directive itself.
@Directive({
selector: '[isSelected]'
})
export class IsSelectedDirective {
//I need to retrieve all elements with my directive
}
In the provided StackBlitz code, when hovering over an h1 tag, the hovered tag should have opacity of 1 while the rest of the h1 tags should have opacity of 0.5.
Feel free to leave a comment if you require any further information.