Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the earliest lifecycle hook where a @ViewChild reference is guaranteed to be available?

  1. A constructor
  2. B ngOnInit
  3. C ngAfterViewInit
  4. D ngOnChanges
Answer

ngAfterViewInit

View children only exist after the component's own view has been initialised, which is what ngAfterViewInit signals.

All Angular MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as