Hi! I am a longtime developer with a passion to empower other developers to be their best. I focus on cloud development and everything related to data access from .NET and .NET Core.
Correct. In the simple DI example you pass a label (string), then an array that should have the function constructor, factory, or instance as the last element.
Great! And in this case: "$jsInject.register("engine", ["pistons", Engine]);", you have to pass the "pistons" in the array too because "Engine" receives "pistons" as a parameter, right? And then the last element would be "Engine" cuz is the "current class".
Hi! I am a longtime developer with a passion to empower other developers to be their best. I focus on cloud development and everything related to data access from .NET and .NET Core.
You got it! The important part of the illustration is that "pistons" is just a label, not an implementation, so you have flexibility to define it however you see fit elsewhere.
Incredible! But one doubt: when you'll use ".register", you've to specify first the label and then the class, right?
Correct. In the simple DI example you pass a label (string), then an array that should have the function constructor, factory, or instance as the last element.
Great! And in this case: "$jsInject.register("engine", ["pistons", Engine]);", you have to pass the "pistons" in the array too because "Engine" receives "pistons" as a parameter, right? And then the last element would be "Engine" cuz is the "current class".
You got it! The important part of the illustration is that "pistons" is just a label, not an implementation, so you have flexibility to define it however you see fit elsewhere.
Oh, I get it! Then I'll use this label on "$jsInject.get()". Amazing!! Thanks ;)