@ViewChild/@ViewChildren in Angular (Tutorial 35)
HTML-код
- Опубликовано: 10 фев 2025
- @ViewChild/@ViewChildren decorator provides us with a easy and simple way to access and manipulate the properties and methods of a Child Component from a container or root component.
By using @viewchild we can achieve the following things,
• Accessing template of same component
• Accessing the template of child component
The @ViewChild query returns the first matching element from the DOM and updates the component variable on which we apply it.
we must supply the query selector, which can be a string or a type as the first argument to the ViewChild
Please watch my other video that I have created to explain the functionality of Subject and its variants in RxJS, so that you can understand it easily in Angular.
RxJS Subject: • RxJS Subject | What is...
RxJS BehaviorSubject : • BehaviorSubject | Beha...
RxJS Replay Subject: • ReplaySubject | Replay...
Angular Subject and BehaviorSubjet: • Subject and BehaviorSu...
Promises vs Observables: • Promises vs Observable...
Promises vs Observables shorts: • Promise vs Observable ...
DON'T CLICK HERE: shorturl.at/AFGJT
This code is available on github:
github.com/nis...
This Book will help you to understand angular more: amzn.to/3f1nf9q
I have used below FAKE API in demo to illustrate the AsyncSubject:
restcountries....
►Subscribe Now: / nishasingla 🔔 Stay updated!
Watch complete playlist here: • Introduction- Angular ...
Follow us on:
Facebook: / angularjs4beginners
LinkedIn: / nisha-singla-82407aa0
Instagram: / passion4code
#viewchildren #viewchild #nishasingla
Thank you, finally someone who explains @ViewChild clearly.
thank you much 😀😀
Never understood this viewchild and viewchildren until i saw this video. Thanks a lot.
I'm glad my video was able to help you understand this subject.
Iam big fan of your videos.. Excellent explanation.
Very nice tutorial... thankyou somuch
Wow really a great tutorial because its a good description of viewchild n viewchildren. Thanks a lot
Nice explanation easy to understand the concept
very well explained. thanks
very simple but detailed and easy to understand tutorials. thanks a lot !!!
very well explained (y) Keep up the good work.
Thanks 😊
Amazing Explanation in very easy words. hats off to you . such a great tutorial.
Thank you so much for your comment 😀😀👍🏻
Frankly speaking, this short really saved me.
thanks a lots
Thanks for so simple explanation
😀😀
Ramdomly I found this video and its crystal clear for me thanks😊
well explained. thanks
Excellent tutorial! Thank you 👍
Thanks
Very simple and clear video
Thanks for your teaching 🎉
Explain in simple way, Thanks
wow how easily you explained
thanks for such vedios.😊🙂
Excellent simple Explanation .
Wow! Crisp and Clear 👍
Thanks from the bottom of my heart
🙏🙏😊😊
Today only I got to know your channel... Really all your videos are amazing and you know it's superb superb all concepts are very clean and clear... Thanks a lot and really God bless you for your wonderful work
Thank you so much.. Glad to know you like it :)
Stay connected
Very good explanation.
Thanks 😊
such a wonderful explanation...
Very great.. Ur way of explanation is too good.. Thanks for the video
Thank you 🙏
Exactly!!
Thanks ☺️
Super Madam. Thanks for giving valuable Info
😀😀
Great ..Nice.. Very easily you explained Ma'am.. 👍
you are a blessing for angular beginners, thank you so much for your hard work
Simple & to the point. Keep up the good work Nisha.
great tutorial ! thanksss
mindblowing explanation.
you are awesome
Having watched the whole course before, I now use it as a reference.
Thanks again for putting it out there.
Still helping developers a year in 👍🏾
excellent explaination
kept it really simple to understand. cheers
Nice Explaination
Thank you 😊
thanks a lot. You made me tension free.
Thank you 😊
Very well explained..... thank u :)
Finally really understanding these concepts and where everything is supposed to go and how it gets accessed. After countless of tutorials, articles and Maximilian's Schwarzmuller's famous Udemy course put on repeat for these concepts (he does NOT know how to properly explain concepts), you are like a breath of fresh air! Thank you! Going to check out if you also explain the ContentChild concept as well. have an amazing day Nisha! :)
Really glad to know that you finally got what you were looking for ..
Checkout this video Content Projection with ng-content (Tutorial 36)
ruclips.net/video/b71prZA8sQ0/видео.html
Stay connected 🤞🏻😀
Yes I too agree with Cora..Max famous course is not at all digestive for freshers like me ..He never explains basic concepts properly 👀😅..Thanks to you as finally after wasting 2 days I understood some important concepts!! I'm super excited to learn angular from your videos now!!
checkout procademy utube channel for angular hes great for freshers
I couldn't agree more about Nisha -- and I knew she was different inside of 60 seconds of this video. I was working on an exercise that went through the "Difference between Template-Driven and Reactive Forms in Angular" -- and I was running into some compilation errors. One of them involved @ViewChild -- and it was a blessing in disguise because that issue led me here.
As for Maximilian, through immense experience -- my advice would be to never get too hung up on a particular teacher (regardless of reputation). I'm not commenting one way or the other on his courses -- I'm simply saying that if you find yourself repeating the instruction, find someone else who works better for you. I'm sure you know that now, but I wanted to mention it anyway.
For example: I was watching an excellent Udemy course on OOP in C#. The course is great for what it is -- but it doesn't dive into detail (which is fine because it wasn't designed that way). But I had a couple of questions along the way -- where I wanted more detail. That led me to this guy (who blew my mind -- once again, inside of 60 seconds).
PART 1: Constructors in C#.NET Part 1 | C#.NET Tutorial | Mr. Bangar Raju.
That guy dives into detail like nothing I've ever seen -- and he makes every second count. Moreover, by the end of each video -- I understood everything he explained (which is incredibly rare for complexity at that level -- for me, anyway). Once again, that's not a knock on other instructors -- as their instruction is obviously working for some people. And of course, I'm not saying we shouldn't be critical of instructors -- I'm just saying that it often comes down to just finding the right ones for you.
Speaking of which: I already have plenty of good resources on Angular, but I feel quite fortunate to have found Nisha -- as she set herself apart right out of the gate. Gotta love how that works: The frustration of resolving compilation issues and digging deeper to understand -- led me someone who can help me better understand.
. . .
@@akd2487 Probally that guy does not fully understand the concepts...otherwise he can explain it clearly!
Simply amazing !!!! love your teaching style
Very nicely explain
This is the best explanation of @ViewChild() ✨❄️🤍
Best explanation so for this topic
Nisha, you are an excellent trainer with expertise in the subject. You explained such complex concepts/topics of angular effortlessly. I am a big fan of you. I watched your whole angular series and only one word, it is awesome. I have never seen such a detailed explanation of Angular Topics. You really made our life easy. Thank you so much and Hope you will continue to share your knowledge with strugglers.
Amazing content ...very helpful .
Highly recommended for beginners
Your teaching soo simple
Thank you ma'am for this knowledge
OMG this woman is the best Angular Tutor I've seen!
Thank you so much for your excellent videos!
Thank you so much for showing this response 😀😀🙏🙏✌🏻
Awesome Nisha... thanks for the clean and clear explanation
Just Amazing Nisha. Kudos to you !! Thanks a lot
Very nice explanation
Mam your voice is clear and beautiful, I can understand clearly all the concepts, thanks for sharing the knowledge!!
You are really amazing, i have been stuck in this viewchild from very long and you made me understand in single go.. Thank you
Good to know it helped you 😀😀
can i get your number
you are the best. so far I have seen many videos for angular but nobody made it so clear about life cycle hooks thank you so much for keeping it so clean.
I always consider this topic difficult and always try to skip. But you are great, you made me understand it very easily and never forget type. Thank you so much....
Thank you 😊
Good job mam🎉
you are a blessing for angular beginners like me, thank you so much!!!
thanks for the video it really helped me.
This is such a clear explanation, you could easily start with angular development using this series
Wow.. I got this concept.. thanks
Glad to know 😀😀
Appreciated your explanation
So beautifully explained!
Best Explanation
Good tutorial
Superb....Good explained...
Great 👏
Got good clarity of viewchild and viewchild, never been this clear, thanks :)
Keep going!!
Glad it helped!
Quality content Nisha. Completely understood. Subscribed.
Thanks for connecting 😀😀
Clear explanation
Thank you 🙏
very well explained
Great explanation. Thanks for clearing all my doubts on @viewchild and @viewchildren
wow Nisha , this is really good !! keep up the good work . loads of good wishes to you
Thanks a lot 😊
Excellent knowledge.
very well explained
😘😘😘😘
Very nicely explained.
The comparison with JS helped a lot.
Good job
Thank you 😊…
Wow, this is amazing. Described the concept very clearly and into the point. Now I fully understand the concept upto this point. Keep up with great work.
awesome 😊
Thanks! This video cleared up a lot of my doubts!
Great 🎉
Great video, Thanks!!
you are the best
Wonderful.
Thank you 😊
Nisha you are doing marvelous job i loved it super I never saw such types of angular videos in RUclips great job
Thank you so much 🙂
You are explaining all concepts really well Nisha.
Thank you
It helped me a lot to understand the concept clearly. thankyou for your efforts ... 🔥
Thank you 😊
thank you very much
😊😊🙏🙏
Top 🤗
Excellent
nice explanation, most of doubt clear
Mam amazing teaching..... Pls continue the angular series.... It will be helpful for everyone.......
Thank you 🙏 sure
First off, Thank you so much for breaking down the concept of @ViewChild in Angular! I have a question, at 18:15 in the video, in the viewchild.component.html, on the line: Counter {{ child?.counter }}. Why did you add the question mark?
Thanks 😊
? Is basically for optional chaining , just to avoid error when object is undefined
You can read more about this here
ruclips.net/video/3yZuXLjWPjU/видео.html
@@NishaSingla Awesome! Thank you!
wow, very well explained :D
Just a small additional note. Instead of putting ref to a child component we could just put this in our .ts file ->
*@ViewChild(CounterComponent) child: CounterComponent* instead of *@ViewChild('childView) child: CounterComponent*
In this way we are omitting the usage of ref in .html file. Btw, video is super helpful and clear. Thanks :)
Hey thanks for your suggestion.. Appreciate 👍🏻👍🏻😊😊
Thank you so much. This is a great content!
Hey thanks 😊
great Nisha... more thanks for this video.... kindly do video for headers and interceptor concept...
greate ...
Literally..I am addicted to ur videos..such great & wonderful explanation I ever watched on RUclips..thank u so much for ur efforts..it make our life easier technically..🥰👍
Addiction is not good for health. LoL
Your teaching technique is great and also you have very depth knowledge, I have subscribed your channel and looking to learn more complex things about Angular. Thank you
Great
Hey Nisha, you're so good at explaining and you made my day dear. Please post video on resolvers if possible.
Thanks Swathi 😀😀