If i compile and run an angular 2 (or above) application i need to manually go ,to the browser and type localhost path for the output.I need to open the browser automatically whenever i use ng serve command.
6 Answers
ng serve --open
or
ng serve -o
This will automatically opens your default browser to http://localhost:4200/.
Comments
You will need to write a script to do this. Instructions can be found here How to open browser to localhost through npm scripts