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 1/2] 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, From 86a8cb1cda92506de2432dcb518bfc0fee636ddf Mon Sep 17 00:00:00 2001 From: nixa <4dmitr@gmail.com> Date: Fri, 3 Jun 2016 00:00:13 +0300 Subject: [PATCH 2/2] fix(route): fix #2, add a default handler for non registered routes --- src/app/app.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f92d575f..22271f7d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -36,6 +36,13 @@ import {layoutPaths} from './theme/theme.constants'; component: Pages, useAsDefault: true }, + // handle any non-registered route + // and simply redirects back to dashboard page + // you can specify any customer 404 page while it's not built in ito ng2-admin + { + path: '/**', + redirectTo: ['Pages'] + } ]) export class App {