πŸ“Š Angular
Q. How do you declare a service to be provided only in a specific Angular module?
  • (A) Add it to the 'providers' array of that module
  • (B) Use providedIn: 'root'
  • (C) Add it to component's providers array
  • (D) Declare it as private
πŸ’¬ Discuss
βœ… Correct Answer: (A) Add it to the 'providers' array of that module

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

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