πŸ“Š Angular
Q. How can you inject a service into a component?
  • (A) By adding it to the component constructor parameters
  • (B) By importing the service file
  • (C) By using @Injectable decorator in the component
  • (D) By using @Component decorator
πŸ’¬ Discuss
βœ… Correct Answer: (A) By adding it to the component constructor parameters

Explanation: Services are injected via constructor parameters and Angular DI system.

Explanation by: Mr. Dubey
Services are injected via constructor parameters and Angular DI system.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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