I am facing a challenge in trying to trigger a "keydown.enter" event from a parent component to a child component. Despite my efforts, I have not been successful in achieving this. Can someone provide me with guidance on how I can make this work?
ParentComponent.html
<form [formGroup]='parentForm'>
<div>
<input type='search' placeholder="search (keydown.enter)="search($event)">
</div>
<app-child (keydown.enter)="search()" [childForm]="parentForm.controls.childForm">
</app-child>
</form>
ChildComponent.ts
@Output() keydownEnter = new EventEmitter(); // The keydown.enter does not seem to function as expected
ngAfterViewInit() {
// Attempting to implement something like..
this.keydownEnter.emit({
// Unfortunately, the keydown.enter is not producing the desired result
});
}