import { Directive, HostListener, inject } from '@angular/core';

import { AccordionLinkDirective } from './accordionlink.directive';

@Directive({
    selector: '[appAccordionToggle]',
    standalone: true,
})
export class AccordionAnchorDirective {
    protected navlink: AccordionLinkDirective;

    constructor() {
        const navlink = inject<AccordionLinkDirective>(AccordionLinkDirective);

        this.navlink = navlink;
    }

    @HostListener('click')
    onClick() {
        this.navlink.toggle();
    }
}
