Is it possible to transfer the value entered in a textbox to another directive's input variable without utilizing ngModel? I am curious about how this can be accomplished. Here is the code snippet:
HTML :
<input type="text" placeholder='Enter text here' /> **This textbox stores the user's input**
<searchDirective [searchText]=''></searchDirective> **The goal is to pass the value from the textbox to the [searchText] input variable**
*In searchDirective.component.ts :*
export class searchDirective implements OnInit {
@Input() searchText: string;
ngOnInit(): void {}
@HostListener('click', ['$event']) onClick($event) {
**I need to extract the user input value from the textbox on this click event**
}
}