components: md-overlay-container duplicated with angular-hmr
Bug:
When using Hot Module Reload and
provide(OVERLAY_CONTAINER_TOKEN, {useValue: createOverlayContainer()}),
each reload duplicates md-overlay-container overlay div
What is the expected behavior?
Only one overlay div
What is the current behavior?
Overlay div duplicated
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 20 (6 by maintainers)
Please, HMR is reaaaaaaaaaaaaaaaallly necessary feature for us, EVERY DAY!
Dear Material team, Could you make HMR work properly with material 2?
I’m experiencing the same as @borislemke reports. I added HMR to my project and if there’s a dialog open, a ghost overlay-container is added.
More importantly, the dialog loses it’s bind to the styles. If you look at the
<head>
section of the document, among the injected<styles>
tags you can find the specific<style>
dedicated tomat-dialog-container
. After a save (with hmr enabled), this style tag disappears. Angular “forgets” to inject the style back to the document.To reproduce:
mat-dialog-container
element<style>…</style>
link to the right of themat-dialog-container
class name - It’ll take you to the <head> section and focus you on the relevant<style>
tag<style>
tag in the head disappears.I hope someone can get to the bottom of this. As I work on dialogs at the moment, I have to disable HMR as it makes it impossible to save any changes without a manual reload of the page.
Before HMR reload
After HMR reload
Any update on this issue, it’s been over two years and to be honest while the ‘hack solution’ suggested by seabass223 works it’s quite cumbersome and should not be required.
@torabian dude beat it with the completely unrelated self promotion