Random reloads Angular 4 (live-reload) Random reloads Angular 4 (live-reload) angular angular

Random reloads Angular 4 (live-reload)


As already explained its a feature provided by your code editor, currently I am using visual studio code and if you read the documentation, it clearly mentions this feature as a live update. Whenever you save your changes, Visual studio triggers an event which compiles your code via the instance of cmd you are sharing data to the port.

Just take some time out reading the documentation for VS code, it has added a bulk of feature especially to support Angular development.

https://code.visualstudio.com/docs/nodejs/angular-tutorial


Your page will be refreshed every time, when watching files will be changed and saved. Normally it happens on every regular save (expected behavior), but in most IDEs you can On/Off autosaving, so if it's On, for example WebStorm saves changes on every frame deactivation and page reload occurs. I suggest, that other IDEs have totally the same behavior. Here is info, how to trigger autosave

in WebStorm:

https://www.jetbrains.com/help/webstorm/saving-and-reverting-changes.html#tuning-autosave

in Android Studio:

How to disable Auto Save save in Android Studio

in Sublime Text:

http://lucybain.com/resources/setting-up-sublime-autosave/


try to run your app with argument --lr=false,

by default live-reload is true and and a server working for watch mode reload app depending on its setting.