Open wuzhouyang opened 7 years ago
hmr is destroying the angular app and bootstrapping the app again with the changes so if you're missing teardown logic in your components then there will be problems. same with not transferring state from one app to the next.
in this lifecycle hook hmrOnDestroy(store)
you need to transfer state into the store during teardown to resume the state for the next app
in this lifecycle hook hmrOnInit(store)
you will get state in the store from the previous app so this is where you would hydrate your app with it to when it bootstraps the app will look the same
In my project i use the Bootstrap, when i open a modal or open the dropdown buttons, i edit some css and save, then the modal will be hided,the dropdown buttons will be shrinked. And i create some DOM dynamically, similarly i edit some css then save,the DOM which i create was disappeared... i want to know the reason,thnx!!!