AngularJs – LinkedIn Skill Assessment
Q1. What is the purpose of the ViewChild decorator in this component class? @Component({ . . . template: ‘<p #bio></p>’ }) export class UserDetailsComponent { @ViewChild(‘bio’) bio; } It provides access from within the component class to the ElementRef object for thetag that has the bio template reference variable in the component’s template view. It provides access from within the …
- 1Share