← BYTES
AngularJS·Starter·Ref: 5.1.20

At a basic conceptual level, what is 'dependency injection' in AngularJS?

Have a question about this video? Mention reference 5.1.20 when you contact us.

a.A pattern where a component (controller, service, directive, etc.) declares what it needs by name, and the framework supplies those dependencies automatically rather than the component constructing them itself
b.A security vulnerability class
c.A way to inject raw HTML into the DOM
d.A deprecated AngularJS 1.0-only feature
Instead of a controller manually creating a $http client or a custom service itself, it just lists the names it needs as function parameters, and AngularJS's injector looks up and supplies the correct instances -- this is central to how testability and modularity work in AngularJS.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES5120#AngularJS