1

I'm very new to Angular, and went to the documentation - hero and tried it. And I need to generate new component by using the cmd ng generate component heroes .

But I can't interact with the cmd, or let me type for the next line. Is there any other way to proceed?

cmd

1 Answer 1

2

Open a new cmd prompt and go to the project location and type ng g c heroes.

in your screenshot, you have started the server and so you cant do anything here. Open a new terminal and try the command.

Sign up to request clarification or add additional context in comments.

4 Comments

Can I do this manually? Like create a component under app, and manually created the 3 files - heroes.component.html (.css & .ts) ?
Yes, u can create a component manually as well. For that, make sure you are adding it in app.module.ts under @NgModule's declaration section. For services, you'll have to add under provider of @NgModule. The DI(Dependency injection) part is handled by angular-cli while creating a component/provider etc
Many thanks, I just run multiple terminal in Visual Studio Code.
Great! same as opening new terminal ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.