From c276c5535ad14d6001803746b355f3f43843ab81 Mon Sep 17 00:00:00 2001 From: nixa <4dmitr@gmail.com> Date: Thu, 2 Jun 2016 23:44:28 +0300 Subject: [PATCH] fix(todo): fix #7 adding empty todo item issue --- src/app/pages/dashboard/todo/todo.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/dashboard/todo/todo.component.ts b/src/app/pages/dashboard/todo/todo.component.ts index b10ab191..8d9b2bb4 100644 --- a/src/app/pages/dashboard/todo/todo.component.ts +++ b/src/app/pages/dashboard/todo/todo.component.ts @@ -33,7 +33,7 @@ export class Todo { addToDoItem($event) { - if ($event.which === 1 || $event.which === 13) { + if (($event.which === 1 || $event.which === 13) && this.newTodoText.trim() != '') { this.todoList.unshift({ text: this.newTodoText,