Bird
0
0

What is the default folder where Angular CLI creates a new component when you run ng generate component my-component?

easy📝 Conceptual Q1 of 15
Angular - Components
What is the default folder where Angular CLI creates a new component when you run ng generate component my-component?
AInside the <code>src/styles</code> directory
BInside the <code>src/assets</code> directory
CInside the <code>src/environments</code> directory
DInside the <code>src/app</code> directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand Angular CLI default behavior

    By default, Angular CLI creates components inside the src/app folder unless a different path is specified.
  2. Step 2: Analyze the command context

    The command ng generate component my-component without a path creates the component in src/app.
  3. Final Answer:

    Inside the src/app directory -> Option D
  4. Quick Check:

    Default component location = src/app [OK]
Quick Trick: Default components go inside src/app folder [OK]
Common Mistakes:
  • Assuming components go into assets folder
  • Thinking components are created in environments
  • Confusing styles folder with component location

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes