Prepare for Angular Interviews with real-life questions. Utilize quizzes and examples to deepen understanding and enhance your skills. Gear up to ace your interview!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is the command to create a new Angular project?

  1. ng create project-name

  2. ng new project-name

  3. ng generate project-name

  4. npm start project-name

The correct answer is: ng new project-name

The command to create a new Angular project is "ng new project-name." This command is part of the Angular CLI (Command Line Interface), which provides a set of tools to initialize, develop, scaffold, and maintain Angular applications. When using "ng new," the command generates a new directory with all the required files and configurations for an Angular application. This includes setting up a default folder structure, creating a package.json file, and installing necessary dependencies, like Angular core libraries. The "project-name" placeholder is replaced with the desired name of the project. In contrast, other options do not correspond to the correct command for creating a new Angular project. "ng create" is not a valid command within the Angular CLI; rather, "ng generate" is used for generating various Angular artifacts (like components, services, etc.) after the project has already been created. The "npm start" command is typically used to serve an existing project, not to create a new one.