Fix submit on enter.
This commit is contained in:
parent
e68db9f54a
commit
061cda89d0
@ -10,8 +10,8 @@ import { Account } from './account';
|
||||
selector: 'account-form',
|
||||
exportAs: 'accountForm',
|
||||
template: `
|
||||
<form class="form-horizontal simple-form" novalidate
|
||||
(ngSubmit)="submit()" [formGroup]="form">
|
||||
<form novalidate
|
||||
(keyup.enter)="submit()" [formGroup]="form">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-5 control-label" [for]="name.key">Account name</label>
|
||||
|
||||
@ -74,7 +74,9 @@ export class AccountFormComponent implements OnInit {
|
||||
}
|
||||
|
||||
submit() {
|
||||
this.submitEventEmitter.emit();
|
||||
if(this.form.valid) {
|
||||
this.submitEventEmitter.emit();
|
||||
}
|
||||
}
|
||||
|
||||
get name() {
|
||||
|
Loading…
Reference in New Issue
Block a user