You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MdlLayoutComponent's onDestroy() the MdlScreensizeService is destroyed and because it is a singleton the layout breaks if you go back from a different page not using mdllayout:
This is also valid if you have multiple instances of MdlLayout on different pages. As soon as you leave the first instance the service is destroyed and the second instance doesn't work properly anymore.
The only workaround is to provide the MdlScreenSizeService in the components using MdlLayout which leads to multiple instances which costs some performance.
In addition, the MdlScreenSIzeService is not usable as API as its state depends on the Layouts Lifecycle.
You have two options:
Provide the service in mdllayout component so that a new instance is created every time. The downside is that the service cannot be used as API
Remove the destruction of the service and provide it as singleton. The downside is that it might unnessesarily listen to the media query if users dont use mdllayout at all
I have created a sample project to demonstrate the issue:
Hello Michael,
unfortunately i came accross another issue:
In the MdlLayoutComponent's onDestroy() the MdlScreensizeService is destroyed and because it is a singleton the layout breaks if you go back from a different page not using mdllayout:
This is also valid if you have multiple instances of MdlLayout on different pages. As soon as you leave the first instance the service is destroyed and the second instance doesn't work properly anymore.
The only workaround is to provide the MdlScreenSizeService in the components using MdlLayout which leads to multiple instances which costs some performance.
In addition, the MdlScreenSIzeService is not usable as API as its state depends on the Layouts Lifecycle.
You have two options:
I have created a sample project to demonstrate the issue:
https://github.com/mscu/mdl-layout
Thanks a lot and best regards
Matthias
The text was updated successfully, but these errors were encountered: