What is the difference between viewchild and contentchild?



What is the difference between viewchild and contentchild?..

Answer / Uday Kumar Ojha

viewChild is used to query for a child view element, while contentChild is used to query for a child content element. The main difference lies in that viewChild queries for the direct child of the current component, while contentChild can query for descendants.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

How AngularJS is different from other JavaScript Framework?

1 Answers   SLK Software,


What is a function decorator?

1 Answers  


What is ng bind in angular?

1 Answers  


How to load select box during page initialization using AngularJS?

1 Answers  


What is difference between $cookies and $cookieStore service?

1 Answers  


Which is the most stable version of angular?

1 Answers  


How to redirect to 404 or other path if the path does not exist in angular 2?

1 Answers  


What are the differences between service and factory methods?

1 Answers  


What is the new in angular 7?

1 Answers  


What is the difference between an order and a directive?

1 Answers  


What is angular libraries?

1 Answers  


What is the difference between link and compile in angular.js?

1 Answers  


Categories