How can I get reference of child component and emit a value from child component
问题 I have a parent component ValidateSessionComponent which has a child component LoginFormComponent . In my unit test, I want to emit a value from LoginFormComponent but I am unable to figure out how I can do so. The HTML of the ValidateSessionComponent has reference of the LoginFormComponent . <app-login-form #loginForm (formOutputEvent)="handleFormValues($event)" [userId]="username"></app-login-form> The LoginFormComponent looks like export class LoginFormComponent implements OnInit {