I have a mat-accordion which has a mat-expansion-panel set like this:
<mat-expansion-panel *ngFor="let item of menuItems; index as i" [hideToggle]="item.hideToggle" [expanded]="item.active">
You can see the "expanded" input is true if "item" has the boolean property "active" evaluating as true. Well, here is the weird part: if "item.active" is set synchronously, for example on the ngOnInit method of my component, everything works and the panel opens. However, if "item.active" is set asynchronously, e.g. inside a "subscribe" method of an observable, panel does not open. Why does this happen, and how can I fix it?
Thank you in advance, Thomas