From 061cda89d0399e478d45175a8904b14b18281409 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Tue, 8 Aug 2017 23:37:09 +0200 Subject: [PATCH] Fix submit on enter. --- src/accounts/accountForm.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/accounts/accountForm.component.ts b/src/accounts/accountForm.component.ts index f3ca212..3f71f6e 100644 --- a/src/accounts/accountForm.component.ts +++ b/src/accounts/accountForm.component.ts @@ -10,8 +10,8 @@ import { Account } from './account'; selector: 'account-form', exportAs: 'accountForm', template: ` -
+
@@ -74,7 +74,9 @@ export class AccountFormComponent implements OnInit { } submit() { - this.submitEventEmitter.emit(); + if(this.form.valid) { + this.submitEventEmitter.emit(); + } } get name() {