What Is the Difference Between Viewchild () and Contentchild ()
Is Used to Select an Element from Component’s Template While Contentchild Is Used to Select Projected Content. What Is the Difference Between Viewchild and...
What is the difference between @ViewChild and @ContentChild ? ViewChild is used to select an element from component’s template while ContentChild is used to select projected content.
What is the difference between ViewChild and ViewChildren?
Another critical difference is that @ViewChild returns a single native DOM element as a reference, while the @ViewChildren decorator returns the list of different native DOM elements in the form of QueryList , which contains the set of elements.
What is @ContentChild?
ContentChildren is a parameter decorator that is used to fetch the QueryList of elements or directives from the content DOM. The QueryList is updated whenever the child element/component is added or removed.