Reputation: 445
is there any way to set an angular mat panel expandable always expanded?. I don't want to close it when user clic on the panel header
Thanks...
Upvotes: 6
Views: 15172
Reputation: 429
A better solution:
.mat-expansion-panel-header { pointer-events: none; }
You will need to disable view encapsulation:
encapsulation: ViewEncapsulation.None
Upvotes: 0
Reputation: 1804
*ngIf helped me in my case where I needed to check for variable from service and if it is set to true then I will expand the panel:
<mat-expansion-panel *ngIf="navigationService.varIsTrue || true"
[expanded]="navigationService.varIsTrue"
</mat-expansion-panel>
Upvotes: 0
Reputation: 1127
Below code works for all scnerio, please check.
<mat-expansion-panel *ngIf="currentCommittee" [expanded]="true">
Upvotes: 3
Reputation: 474
<mat-expansion-panel [disabled]="true" [expanded]="true">
see https://material.angular.io/components/expansion/api
Upvotes: 14