`ng serve --hmr` should apply changes in component styles without reinitialization of the whole app #19867
Comments
|
I did look into a way to achieve this in the past. This is a non-trivial problem to solve, I will do some investigation but i think the the Framework needs to provide an API. See: angular/angular#39367 |
|
One addition: it's not only about the styles. |
|
I am very helpless, which means that Angular is not suitable for building large applications |
|
I am also a bit flummoxed, how hot reloading is still a problem for Angular. Current solution seems very heavy handed, as it reloads whole module. For single-module applications, or applications with bigger modules, that does almost nothing. |
|
Any hopes that this will be addressed any time soon? |


Command (mark with an
x)Description
Currently during
ng serve --hmrany change in component styles triggers reinitialization of the whole app. This behavior is far from ideal as route components in most of the apps need to load data asynchronously and their reinitialization triggers this process again, so applying a change in component's styles can't be reviewed immediately (as it should and as it's done in other frameworks like Vue or React).I've created a reproduction repo:
npm ci && npm startand openlocalhost:4200Initializing page...and thenPage ready.TestPageComponentsimulates data loading in it'sngOnInitmethod.background-color: blue.TestPageComponentwill be reinitialized and you'll be able to review the change only after 3 seconds.Describe the solution you'd like
I expect changes in component styles to be applied immediately without reinitialization of the host component.
By the way, changes in global styles are applied immediately, as they should.
The text was updated successfully, but these errors were encountered: