Bird
0
0

What files are created when you run ng generate component footer in an Angular project?

medium📝 component behavior Q13 of 15
Angular - Components
What files are created when you run ng generate component footer in an Angular project?
Afooter.component.js, footer.component.html, footer.component.css
Bfooter.ts, footer.html, footer.css, footer.spec.ts
Cfooter.component.ts, footer.component.html, footer.component.css, footer.component.spec.ts
Dfooter.component.ts, footer.html, footer.css, footer.spec.js
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular component file structure

    Angular components generate four files: TypeScript, HTML, CSS, and a test spec file, all with the component name prefix.
  2. Step 2: Match the correct file extensions and naming

    The files have extensions .ts, .html, .css, and .spec.ts with the component name and '.component' in the filename.
  3. Final Answer:

    footer.component.ts, footer.component.html, footer.component.css, footer.component.spec.ts -> Option C
  4. Quick Check:

    Angular components create 4 files with .component and correct extensions [OK]
Quick Trick: Remember 4 files: .ts, .html, .css, .spec.ts [OK]
Common Mistakes:
  • Missing the .spec.ts test file
  • Using .js instead of .ts
  • Omitting '.component' in filenames

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes