#62 Dependency Injection | Angular Services & Dependency Injection | A Complete Angular Course

preview_player
Показать описание
In the last lecture, we learned that creating an instance of a service class inside a component is not a good practice because it makes component class tightly coupled with service class. Instead, we can ask angular to inject an instance of the service class which we want to use in our component class. This can be achieved using dependency injection. Let's learn what is dependency injection and how it works in Angular.

Рекомендации по теме
Комментарии
Автор

Love the way you teach and love the series! I’m glad the series is continuing as I’m almost done with all the videos. Thank you very much to you and anyone (if there is anyone else behind the scenes) for making these videos!

marcotorres
Автор

Thank you so much for this amazing video, I've finally grasped the concept of dependency injection

dr.faithadhiambo
Автор

I really liked the way you describe concepts, thanks for making a free course like this, Sir. Could you make a course on SASS please?

MehediHasan-ntmw
Автор

Nice video, I have a request and suggestion, can you make video series on unit testing in angular also. There is very lack of good data on it on internet.

ankurvyas
Автор

What will happen if I do not create providers of meta data? I've noticed that it is working fine if it is not there in the meta data object...

PremKumar-qhwt
Автор

Thank you very much for these great videos 😊

El_Bald
Автор

But now also if we change the class SunscribeService, wont it break the application? The issue of what if the class changes or some method from it gets removed, then we wont be able to access it, persists, How DI has helped? Some more clarity needed.

sohamajgaonkar
Автор

when i add providers only in one component, it is working fine for the rest of other components as well

lalithreddyjanga
Автор

Love the videos ...
in this one though, there seems to be spelling mistakes on the slide at 6:11 ... subService vs subservice vs SubService.

stevewitman