PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
506 stars 45 forks source link

Styles are duplicated when module is reloaded #19

Closed paralin closed 8 years ago

paralin commented 8 years ago

Pretty minor problem (really impressive code btw!) - when a Component with the styles property is set is reloaded, maybe only when view encapsulation is turned off, it will append a <style> tag to the header. The bug is that the old <style> tag is not deleted, so you'll get for n reloads, n+1 duplicate style tags.

Solution I think (maybe a cludgy one) would be to check the "style" tags added by the component and delete them before reloading.

benetis commented 8 years ago

+1

PatrickJS commented 8 years ago

this is fixed in the rc5-rc6 release https://github.com/AngularClass/angular2-seed/blob/e5c2c3c2b8d8a96420d59d21f8e040a8f9d634c1/src/main.browser.ts#L34...L51