This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Description
I have a component with a mat-expansion-panel in it. The component is placed in a loop. Here is the view of the component:

I grab it with @ViewChild and based on data that comes from server, I expand some of them. I do that this way:
@ViewChild("expansionPanel") expansionPanel;
and after that, I subscribe to response of server and inside it, based on some conditions, I do this to open the panel:
this.expansionPanel.expanded = true;
Everything is okey and working well.
But problem begins when I navigate with the router to another place in the app.
After coming back to the page that has this component, that line of code doesn't work anymore and does not open the mat-expansion-panel.
I tested it so much and it certainly reaches to this line again but does not work.
If I reload the page, everything is alright and works fine again.
I think the problem is with mat-expansion-panel and angular router.