I want to control my mat-expansion-panel solely with the panel's [expanded] input property. I am using NGRX as state management.
Therefore, I don't want the panel to open when clicked. Instead, I have my own click listener that will dispatch the right action that will lead to the panel to open.
How can I prevent it from opening when clicked? I tried (click)="$event.stopImmediatePropagation(); but it does not do the trick.
<mat-accordion [multi]="true">
<mat-expansion-panel [expanded]="item.isOpen">
<mat-expansion-panel-header (click)="togglePanel($event, item)">
<!-- Header Content-->
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<!-- Panel Content -->
</ng-template>
</mat-expansion-panel>
</mat-accordion>
Any ideas?