-1

The concept of dependency injection is not clear to me. I read about it. What i learn is it is used to inject dependency instead of adding it. Can someone explain it to in simple way if possible with example?

robot
  • 71
  • 2
  • 7

1 Answers1

0

In simple words, when you utilize an already defined function into your code instead of going through the complexity of writing the predefined function again, you need to add the library to your code where the function has been previously defined. This is known as dependency injection; where you are injecting another module into your code which would help you code easier.

RedWolf
  • 24
  • 3