I am writing an Angular 2 unit test. I have a @ViewChild
subcomponent that I need to recognize after the component initializes. In this case it\'s a Timepicke
Even after following everything from the accepted answer, you are getting undefined instance of child component then kindly check if that component is visible.
In my case, there was *ngIf
applied on the control that's why instance of child was undefined then I removed and checked and it worked for me