Can't use the CLI / command prompt after ng serve
When you use ng serve
you create a local development server on that shell instance which listens for requests. As long as that server is running, you can’t use that shell instance because it’s busy listening for HTTP requests.
The solution is to a open a new terminal tab or window and run terminal commands from the shell instance from there.
If you are working in window, you can use ctrl + C.
Upon which it will ask
Terminate Batch Job (Y/n)?
Just select n and you will be able to edit in the same command prompt.
Please note that after you are done with changes, in order to reflect it on the browser, you need to enter ng serve again.
Also Having said that above, if you want to get access to the command prompt/Console in visual studio(If by chance you are using it). you can get it to further write your code in console provided by the editor. Just press ctrl + ` Combination, you will get the same command prompt.