更新时间:2023-02-12 11:24:10
Inside Directive :
Inside Directive :
您可以使用@Output
发送事件并以形式捕获它
You can use @Output
to send an event and capture it in the form
@Output typeaheadResult = new EventEmitter();
...
// Whenever user selects a result dispatch the event
this.typeaheadResult.emit(changedInput);
在您的 HTML 中,您可以捕获它
Inside your HTML you can capture it
<input formControlName="name"
myTypeahead="'http://someRemoteUrl'"
(typeaheadResult)="doSomething()"
/>