Bird
0
0

Which file extension is generated by Angular CLI when creating a new service?

easy📝 Syntax Q3 of 15
Angular - Services and Dependency Injection
Which file extension is generated by Angular CLI when creating a new service?
A.component.ts
B.service.ts
C.module.ts
D.directive.ts
Step-by-Step Solution
Solution:
  1. Step 1: Identify the naming convention for Angular services

    Angular services use the suffix .service.ts for their TypeScript files.
  2. Step 2: Compare with other Angular file types

    Components use .component.ts, modules use .module.ts, and directives use .directive.ts.
  3. Final Answer:

    .service.ts -> Option B
  4. Quick Check:

    Service files end with .service.ts [OK]
Quick Trick: Service files always end with .service.ts [OK]
Common Mistakes:
MISTAKES
  • Confusing service files with component files
  • Using wrong suffixes like .module.ts
  • Assuming services have no suffix

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes