πŸ“Š Angular
Q. How can you make a service available only to a specific module?
  • (A) Provide it in that module’s providers array
  • (B) Add @Injectable({providedIn: 'root'})
  • (C) Provide it in AppModule only
  • (D) Declare it in a component
πŸ’¬ Discuss
βœ… Correct Answer: (A) Provide it in that module’s providers array

Explanation: Providing a service in module limits its scope to that module.

Explanation by: Mr. Dubey
Providing a service in module limits its scope to that module.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
37
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate