Local reference variables @viewchild() and @contentchild() in angular?
Loading
Local reference variables @viewchild() and @contentchild() in angular?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Brahma Prakash ShuklaPosted Nov 6, 2022, 7:09 AM
https://www.infragistics.com/community/blogs/b/infragistics/posts/simplifying-viewchild-nad-contentchild-in-angular
Vishal JoshiPosted Oct 20, 2022, 1:05 PM
@Viewchild
The Child Element which is located inside the component template
@Contentchild
Any element or component projected inside becomes a ContentChild. If you want to access and communicate with ChildComponent projected inside ParentComponent, you need to read it as ContnetChild.
ViewChild and ContentChild are two very important features of Angular. It is used to access Child Component in the Parent Component.