Creating a Service in Angular | Services & Dependency Injection | Angular 12+

preview_player
Показать описание
In this lecture, we will create a very simple service to understand how services are useful in angular for code re-usability. In the last lecture we theoretically understood what a service is.

Let's go ahead and create a service in this lecture and let's use that service in different components of our angular application.
Рекомендации по теме
Комментарии
Автор

This is something I can really apply in real work, other youtubers give such bad examples/implementaions that do not help. it helps only to understand something that you will not use.

YouCantGetBrokeByGiving
Автор

By the way, what has not been mentioned in the video, or simply has not been accented, is that by using a service we do not just avoid duplicating code, but making our app more flexible and scalable. Imagine if you want to change some logic of inserting a user to a database, if you have separate duplicate realisations of this method in different components, than, you will have to change the logic in EACH function separately, it takes more time and has a higher chance of making a mistake. Using a service like this, on the other hand, you will have only one method, and changes in one place of your app will make the whole other behaviour of all the components, without changing each of them one by one. Therefore, such an attitude provides a way greater maintenance options with lesser resources.

michaeltkachenko
Автор

Wohhhoooo...explaining a way like a small kid will understand

mozammilahmad
Автор

Thank you sir for putting the effort in this course. I would say this is the best Angular course I found on Youtube. The examples you give are more realistic and related to world which helps to understand everything with great ease. I'll recommend this course to everyone who want to learn Angular. Lot's of love for you Sir.

SaadAliAlkhairi
Автор

This is good information.. thanks for making video .. waiting on dependency injection..

raghuguru
Автор

I like your style very much, thank you for your hard work!

YouCantGetBrokeByGiving
Автор

Explanation is great, easy to understand. Thank you

sumaganjal
Автор

is it okay to import this service in appModule component to avoid importing it in all componenets ?

ahmedshehata
Автор

Great video. Very simple and informative. Thank you!

matthewcullinane
Автор

@procademy
can we intialise the service class in OnInit() life cycle hook

sivaprasad
Автор

hundreds of thousands of lines in one method? damn I've yet to experience that

cliniclown
Автор

sir pls give me CSS code of this project

VamshithGB
Автор

looks like you just learned ng, that's not how services are used now. and where is DI?

hcrbangladesh
Автор

Hello
Can you pls share a video for contact form sending mail

DineshKumar-bybv
Автор

sir can you create javascript playlist

esthermatangi