From 8153c2a9865bace94b3667f7d44dea8d72991750 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Fri, 3 Mar 2017 09:05:29 +0100 Subject: [PATCH] Optimize blog component routing --- project-manager-reactive/src/app/app.routing.ts | 5 +++-- .../src/app/blog/{ => blog-entry}/blog-entry.component.html | 0 .../src/app/blog/{ => blog-entry}/blog-entry.component.ts | 2 +- .../src/app/blog/{ => blog-entry}/blog-entry.ts | 0 project-manager-reactive/src/app/blog/blog.component.html | 2 +- project-manager-reactive/src/app/blog/blog.component.ts | 2 +- project-manager-reactive/src/app/blog/blog.routing.ts | 4 ++++ project-manager-reactive/src/app/tasks/tasks.routing.ts | 3 --- 8 files changed, 10 insertions(+), 8 deletions(-) rename project-manager-reactive/src/app/blog/{ => blog-entry}/blog-entry.component.html (100%) rename project-manager-reactive/src/app/blog/{ => blog-entry}/blog-entry.component.ts (88%) rename project-manager-reactive/src/app/blog/{ => blog-entry}/blog-entry.ts (100%) create mode 100644 project-manager-reactive/src/app/blog/blog.routing.ts diff --git a/project-manager-reactive/src/app/app.routing.ts b/project-manager-reactive/src/app/app.routing.ts index 29e5481..4066e7f 100644 --- a/project-manager-reactive/src/app/app.routing.ts +++ b/project-manager-reactive/src/app/app.routing.ts @@ -6,9 +6,10 @@ import {AboutComponent} from './about/about.component'; import {LoginComponent} from './login/index'; import {BlogComponent} from './blog/blog.component'; import {NotFoundComponent} from './not-found/not-found.component'; -import {tasksRoutes, tasksRoutingComponents, tasksRoutingProviders, blogComponents} from './tasks/tasks.routing'; +import {tasksRoutes, tasksRoutingComponents, tasksRoutingProviders} from './tasks/tasks.routing'; import {RxDemoComponent} from './rxdemo/rxdemo.component'; import {LoginGuard} from './login/login.guard'; +import {blogRoutingComponents} from "./blog/blog.routing"; export const appRoutes: Routes = [ {path: 'dashboard', component: DashboardComponent, data: {title: 'Startseite'}}, @@ -33,7 +34,7 @@ export const appRoutes: Routes = [ export const appRouting = RouterModule.forRoot(appRoutes); export const routingComponents = [DashboardComponent, SettingsComponent, AboutComponent, LoginComponent, NotFoundComponent, - RxDemoComponent, ...blogComponents, ...tasksRoutingComponents]; + RxDemoComponent, ...blogRoutingComponents, ...tasksRoutingComponents]; export const routingProviders = [LoginGuard, ...tasksRoutingProviders]; diff --git a/project-manager-reactive/src/app/blog/blog-entry.component.html b/project-manager-reactive/src/app/blog/blog-entry/blog-entry.component.html similarity index 100% rename from project-manager-reactive/src/app/blog/blog-entry.component.html rename to project-manager-reactive/src/app/blog/blog-entry/blog-entry.component.html diff --git a/project-manager-reactive/src/app/blog/blog-entry.component.ts b/project-manager-reactive/src/app/blog/blog-entry/blog-entry.component.ts similarity index 88% rename from project-manager-reactive/src/app/blog/blog-entry.component.ts rename to project-manager-reactive/src/app/blog/blog-entry/blog-entry.component.ts index 5bd3ee6..3f65d49 100644 --- a/project-manager-reactive/src/app/blog/blog-entry.component.ts +++ b/project-manager-reactive/src/app/blog/blog-entry/blog-entry.component.ts @@ -1,6 +1,6 @@ import {Component, Input } from '@angular/core'; import {BlogEntry} from './blog-entry'; -import {BlogComponent} from "./blog.component"; +import {BlogComponent} from "../blog.component"; @Component({ selector: 'blog-entry', diff --git a/project-manager-reactive/src/app/blog/blog-entry.ts b/project-manager-reactive/src/app/blog/blog-entry/blog-entry.ts similarity index 100% rename from project-manager-reactive/src/app/blog/blog-entry.ts rename to project-manager-reactive/src/app/blog/blog-entry/blog-entry.ts diff --git a/project-manager-reactive/src/app/blog/blog.component.html b/project-manager-reactive/src/app/blog/blog.component.html index 622fd07..88f701e 100644 --- a/project-manager-reactive/src/app/blog/blog.component.html +++ b/project-manager-reactive/src/app/blog/blog.component.html @@ -1,4 +1,4 @@ -

Mein Angular-Blog

+

Angular-Blog

Neuen Blog-Eintrag erstellen

diff --git a/project-manager-reactive/src/app/blog/blog.component.ts b/project-manager-reactive/src/app/blog/blog.component.ts index 1433195..38b88ca 100644 --- a/project-manager-reactive/src/app/blog/blog.component.ts +++ b/project-manager-reactive/src/app/blog/blog.component.ts @@ -2,7 +2,7 @@ import {Component} from '@angular/core'; import {ActivatedRoute, ActivatedRouteSnapshot, Router, RouterStateSnapshot} from '@angular/router'; import {Title} from '@angular/platform-browser'; import {initialEntries} from './initialEntries'; -import {BlogEntry} from './blog-entry'; +import {BlogEntry} from './blog-entry/blog-entry'; @Component({ selector: 'blog', diff --git a/project-manager-reactive/src/app/blog/blog.routing.ts b/project-manager-reactive/src/app/blog/blog.routing.ts new file mode 100644 index 0000000..207411e --- /dev/null +++ b/project-manager-reactive/src/app/blog/blog.routing.ts @@ -0,0 +1,4 @@ +import {BlogComponent} from "./blog.component"; +import {BlogEntryComponent} from "./blog-entry/blog-entry.component"; + +export const blogRoutingComponents = [BlogComponent, BlogEntryComponent]; diff --git a/project-manager-reactive/src/app/tasks/tasks.routing.ts b/project-manager-reactive/src/app/tasks/tasks.routing.ts index bb94aba..f60b41f 100644 --- a/project-manager-reactive/src/app/tasks/tasks.routing.ts +++ b/project-manager-reactive/src/app/tasks/tasks.routing.ts @@ -5,8 +5,6 @@ import {EditTaskGuard} from './edit-task/edit-task.guard'; import {TaskOverviewComponent} from './task-overview/task-overview.component'; import {TasksComponent} from './tasks.component'; import {LoginGuard} from '../login/login.guard'; -import {BlogComponent} from "../blog/blog.component"; -import {BlogEntryComponent} from "../blog/blog-entry.component"; export const tasksRoutes: Routes = [{ path: '', component: TasksComponent, @@ -35,4 +33,3 @@ export const tasksRoutes: Routes = [{ export const tasksRoutingComponents = [TasksComponent, TaskListComponent, EditTaskComponent, TaskOverviewComponent]; export const tasksRoutingProviders = [EditTaskGuard]; -export const blogComponents = [BlogComponent, BlogEntryComponent];