Angular Interview Practice Exam 2025 - Free Angular Practice Questions and Study Guide

Question: 1 / 400

How can a new component be generated in Angular using Angular CLI?

ng create component component-name

ng generate component component-name

To create a new component in Angular using the Angular CLI, the command involves using the `ng generate` syntax. This is a fundamental feature of the Angular CLI that streamlines the development process by automating repetitive tasks. The `generate` command generates components, directives, services, and more based on the specified parameters.

When using `ng generate component component-name`, Angular CLI will set up a new component with the appropriate files, including TypeScript, HTML, and CSS files, and it will also update the module declarations where necessary. This ensures that the new component is ready to be used within the application almost immediately.

The other choices do not reflect the correct syntax for generating a new component in Angular. The `create`, `add`, and `make` terms are not part of the Angular CLI command set, which is specifically designed around `generate`, making the correct option clear.

Get further explanation with Examzify DeepDiveBeta

ng add component component-name

ng make component component-name

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy