No video

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

  Рет қаралды 40,271

procademy

procademy

Күн бұрын

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.

Пікірлер: 25
@YouCantGetBrokeByGiving
@YouCantGetBrokeByGiving 2 жыл бұрын
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.
@mozammilahmad8431
@mozammilahmad8431 Жыл бұрын
Wohhhoooo...explaining a way like a small kid will understand
@michaeltkachenko7313
@michaeltkachenko7313 Жыл бұрын
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.
@SaadAliAlkhairi
@SaadAliAlkhairi Жыл бұрын
Thank you sir for putting the effort in this course. I would say this is the best Angular course I found on KZfaq. 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.
@raghuguru8661
@raghuguru8661 2 жыл бұрын
This is good information.. thanks for making video .. waiting on dependency injection..
@YouCantGetBrokeByGiving
@YouCantGetBrokeByGiving 2 жыл бұрын
I like your style very much, thank you for your hard work!
@sumaganjal
@sumaganjal 2 жыл бұрын
Explanation is great, easy to understand. Thank you
@matthewcullinane537
@matthewcullinane537 2 жыл бұрын
Great video. Very simple and informative. Thank you!
@ahmedshehata8964
@ahmedshehata8964 9 ай бұрын
is it okay to import this service in appModule component to avoid importing it in all componenets ?
@user-yd6zi1fs8v
@user-yd6zi1fs8v 5 ай бұрын
Thanks Sir
@hashamniazi3402
@hashamniazi3402 Жыл бұрын
it was really helpful Thank You ♥♥
@cliniclown8786
@cliniclown8786 Жыл бұрын
hundreds of thousands of lines in one method? damn I've yet to experience that
@HealthChampion
@HealthChampion 5 ай бұрын
To be fair to him, he is saying 'Hundreds or thousands of lines of code', not 'of'. Still, thousands of lines of code in one method, I am yet to experience too :)
@cliniclown8786
@cliniclown8786 5 ай бұрын
oh yea, hundreds or thousands is what I meant to say. Have never seen that either, but I'm a beginner software developer@@HealthChampion
@sivaprasad10410
@sivaprasad10410 Жыл бұрын
@procademy can we intialise the service class in OnInit() life cycle hook
@VamshithGB
@VamshithGB Ай бұрын
sir pls give me CSS code of this project
@DineshKumar-by1bv
@DineshKumar-by1bv 11 ай бұрын
Hello Can you pls share a video for contact form sending mail
@esthermatangi
@esthermatangi Жыл бұрын
sir can you create javascript playlist
@hcr2bangladesh
@hcr2bangladesh Жыл бұрын
looks like you just learned ng, that's not how services are used now. and where is DI?
@lxdzii
@lxdzii Жыл бұрын
i'm also shocked at how he implemented the service!
@HealthChampion
@HealthChampion 5 ай бұрын
He is simply showing the old way and covers the DI in next video and he is mentioning that at the end of this video.
@andreiberes9442
@andreiberes9442 4 ай бұрын
Why he did not injected the service in a constructor ? Am i missing something ? Im also new in ng, just asking.
@CHANDRASHEKHAR-hk8sq
@CHANDRASHEKHAR-hk8sq Жыл бұрын
sir where is source code
@procademy
@procademy Жыл бұрын
github.com/manojjha86/complete-angular-13-course
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 22 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 18 МЛН
What is Observable | Observables | Angular 12+
14:16
procademy
Рет қаралды 152 М.
How to Make Forms in Angular REUSABLE (Advanced, 2023)
21:10
Decoded Frontend
Рет қаралды 63 М.
Creating a Custom Component | Components | Angular 12+
21:58
procademy
Рет қаралды 92 М.
Angular Tutorial - 19 - Using a Service
8:39
Codevolution
Рет қаралды 523 М.
What’s new in Angular v18
20:08
Angular
Рет қаралды 117 М.
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 22 МЛН