Angular @ContentChild() and @ContentChildren() | How to access the projected components

Опубликовано: 05 Ноябрь 2024
на канале: World Tech Tube
1,394
10

Share, Support, Subscribe!!
Subscribe: https://bit.ly/3kk36Nh
Source Code: https://bit.ly/3wU9QYk
Youtube:    / worldtechtube  

In this video we will basically try to use @ContentChild and @ContentChildren.

Before starting with this tutorial make sure you have basic understanding of ng-child. Better if you have completed the tutorial https://bit.ly/3iSTsDn so that this tutorial will be easy to undrestood.

We will be creating a sample angular application.
We will be having the required components in order to get the demo.
Unlike the ViewChild and ViewChildren that are used to access the template element and component. The ContentChild and ContentChildren will be used to access the projected components from the host component.
The elements/components that are coming to ng-content element will be access via ContentChild or ContentChildren.
We will try to access the single component and multiple components by projecting the single and multiple components to the projected component from the host component.
We will be using the same QueryList in order to access the multiple components.

#Angular #programming #dotnet #csharp #interview #QuestionsAndAnswers #coding #tutorial #learning #javascript #js #html #css #angularjs #git #github #gitbash #source #versioncontrol #versoning
#ngContent #viewChild #viewChildren #ContentChild #ContentChildren