Video details

Angular ViewChild Decorator Trick (advanced, #shorts, #webdevelopment, #angular )

Angular
09.06.2021
English

Thanks for watching! I would higly appreciate your feedback and comments. Subscribe to my channel and check out my courses.
đź“Ł In-Depth Angular Material Theming Course https://bit.ly/angular-material-theming-workshop
âś… Use 25%-off coupon: YOUTUBE_DISCOUNT

Transcript

Hi angular developers when you need to get a reference to some component directive or service which is declared in some components view, you usually use a view child decorator and as a selector you provide a class name that you are going to resolve. However, on this node usually resides not the only directive, and sometimes you have to keep a selector the same, but the reference should point out to completely different thing element. As example. In this case you you can provide additional config to the view child and here you can declare what you actually want to read. In my case, it could be a reference to the Dom element. Subscribe to my YouTube channel decoded front end if you want to learn more advanced and glare tricks.