mardi 5 avril 2016

Angular2 Unit Test - Testing @ViewChild

I'm trying to test a component that has an @ViewChild annotation. One of the functions that I'm trying to test calls the @ViewChild's element for focus. However, when I try to log out the View Child variable, it is always undefined. I thought componentFixture.detectChanges() would initiate the element ref, but it doesn't seem to.

Is there any way to make it so it isn't undefined?

Aucun commentaire:

Enregistrer un commentaire