Does not trigger enter key pressed during composing input.
npm install --save ngx-enter-key
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgxEnterKeyModule } from 'ngx-enter-key';
import { AppComponent } from './app.component';
@NgModule({
imports: [
BrowserModule,
NgxEnterKeyModule
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
@Component({
selector: 'app-form',
template: `
<input (ngxEnterKey)="onEnterKey($event)">
`
})
export class FormComponent {
onEnterKey(event: KeyboardEvent) {
console.log(event);
}
}