The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Factory Providers with dependencies

Factory Providers with dependencies

3:05
This lesson discusses when and how to add dependencies, resolved by Angular’s DI, to factory providers. The example used in this lesson builts upon the previous lesson on understanding factory providers.
Watch this lesson now
Avatar
egghead.io

This lesson discusses when and how to add dependencies, resolved by Angular’s DI, to factory providers. The example used in this lesson builts upon the previous lesson on understanding factory providers.

Avatar
Raphi

What is gained by adding ConsoleService?

I guess you are just trying to demonstrate using provider dependencies, but could have had a better example nonetheless

Avatar
Jorge Arévalo

In the angular docs states that:

Technically, the @Injectable()decorator is only required for a service class that has its own dependencies.

But in your example, LogDebugger has a dependency on ConsoleService. And works event when you're not using @Inyectable decorator at all.

How is it possible? Or Am I misunderstanding something?

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?