I created an angular2 project using angular-cli. Project is working fine.
I used ng serve command to run it locally for development. Below is the snapshot of CLI after running the project:
Now I want to create a new component using ng generate component command. I have to stop it first using Ctrl + C and then create the component and then start it again. Its time consuming. Is there any other and better way to do it?
Asked
Active
Viewed 1,786 times
5

Robin-Hoodie
- 4,886
- 4
- 30
- 63

awebartisan
- 1,424
- 16
- 27
-
if you are using angular-cli with webpack, there is no need to stop the server – Ali Baghdadi Nov 25 '16 at 09:29
-
1When you say you have to stop it, do you literally mean just because you only have one cmd window? Did you consider *opening another?* – jonrsharpe Nov 25 '16 at 09:30
-
so you are saying i should use two cli windows? commands may conflict? – awebartisan Nov 25 '16 at 09:32
-
@AliBaghdadi I have written the command **ng generate component** right after what is shown in picture but it didn't take any effect. – awebartisan Nov 25 '16 at 09:33
-
you must run it in a separate cli window, this makes no conflict – Ali Baghdadi Nov 25 '16 at 09:59
-
yes it worked. Thanks! – awebartisan Nov 25 '16 at 10:24
2 Answers
6
Please note if you're using VSCode you can open a second terminal window by clicking the + symbol and then toggle between them using the dropdown.
Other similar features may exist in other editors, of you can of course open a standard terminal window of your choice.

Simon_Weaver
- 140,023
- 84
- 646
- 689