Angular2 Live reload


#1

Has anyone got themselves up and running with Angular 2 and live reload?

I’m struggling to find a solution for live reloading, and it’s very frustrating reloading the server each time I want a small change!


#2

I have been using c9 with Angular2 constantly for 8 months and have never had a problem with the live reload, certainly with the standard “quickstart” setup using SystemJS that is provided with the Angular docs. Lite-Server (which is really BrowserSync) works perfectly for me from the scripted “start” command defined in the package.json. (The only issue is the standard one with c9 of assuring that you are using the correct ports (like 8080) and not the ones assigned by default by LiteServer/BrowserSync. The answer to this is to create a bs-config.json file with the desired port referenced as an override But you must already be doing this or you wouldn’t be getting a browser display at all, auto-refreshed or otherwise.)


#3

Want to add that I am using the CLI right now (the new webpack version), and this is also giving me no trouble with auto-refresh.

As with the SystemJS/quickstart approach, you need to override the ports for c9. With the CLI this means calling ng serv e as follows:

ng serve --host 0.0.0.0 --port 8080 --live-reload-port 8081