-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
Description
With Hot Module Reloading I was expecting that only the file/component that I made a change to would be swapped out. However, if you have a service injected into the changed component that is holding some state, that state is refreshed to it's beginning state again.
Setup:
ServiceA has a data property that starts as 'foo'
ComponentA injects ServiceA as public
ComponentA.template = <h1>{{serviceA.data}}</h1><button (click)="serviceA.data = 'bar' ">Click</button>
;
ComponentA button click changes 'data' to 'bar'.
Steps:
Launch app
Click button
Make an edit to ComponentA
Actual:
h1 shows 'foo'
Expected:
h1 to show 'bar'