I am in the middle of a project building a Header component in Angular which has 2 levels of navigation. The basic component structure is as follows:
<b-header>
<b-header-nav>
<b-header-nav-item>
<button b-header-link>Primary 1<button>
</b-header-nav-item>
<b-header-nav-item>
<button b-header-link>Primary 2<button>
</b-header-nav-item>
<b-header-nav-item>
<button b-header-link>Primary 3<button>
</b-header-nav-item>
</b-header-nav>
</b-header>
When the user clicks on one of the b-header-link buttons I would like to toggle CSS active state classes on both the button itself and its parent - b-header-nav-item. I have researched child to parent communication in Angular online but most examples show the use of Output and Event Emitters which I'd ideally not like to use as this work is part of a component library where the inner workings of a component should not really be exposed to the end user. Also as shown the child in this case is added via content projection ng-content in b-header-nav-item. I've created a Stackblitz to demo a more featured example of the code (although still simplified compared to the real one).
Any help would be much appreciated,
Thanks