2017-02-24 22:54:59 +01:00
|
|
|
import {Routes, RouterModule} from '@angular/router';
|
|
|
|
|
|
|
|
import {DashboardComponent} from './dashboard/dashboard.component';
|
|
|
|
import {SettingsComponent} from './settings/settings.component';
|
|
|
|
import {AboutComponent} from './about/about.component';
|
|
|
|
import {LoginComponent} from './login/index';
|
2017-03-02 23:26:26 +01:00
|
|
|
import {BlogComponent} from './blog/blog.component';
|
2017-02-24 22:54:59 +01:00
|
|
|
import {NotFoundComponent} from './not-found/not-found.component';
|
2017-03-03 09:05:29 +01:00
|
|
|
import {tasksRoutes, tasksRoutingComponents, tasksRoutingProviders} from './tasks/tasks.routing';
|
2017-02-24 22:54:59 +01:00
|
|
|
import {RxDemoComponent} from './rxdemo/rxdemo.component';
|
|
|
|
import {LoginGuard} from './login/login.guard';
|
2017-03-03 09:05:29 +01:00
|
|
|
import {blogRoutingComponents} from "./blog/blog.routing";
|
2017-04-05 02:43:17 +02:00
|
|
|
import {ModelDrivenFormComponent} from "./model-driven-form/model-driven-form.component";
|
2017-04-07 04:09:28 +02:00
|
|
|
import {modelDrivenFormRoutingProviders} from "./model-driven-form/model-driven-form.routing";
|
|
|
|
import {ChatComponent} from "./chat-component/chat.component";
|
2017-02-24 22:54:59 +01:00
|
|
|
|
|
|
|
export const appRoutes: Routes = [
|
|
|
|
{path: 'dashboard', component: DashboardComponent, data: {title: 'Startseite'}},
|
|
|
|
{path: '', redirectTo: '/dashboard', pathMatch: 'full'},
|
2017-04-07 02:55:42 +02:00
|
|
|
{path: 'settings', component: SettingsComponent, data: {title: 'Einstellungen'}},
|
2017-02-24 22:54:59 +01:00
|
|
|
{path: 'about', component: AboutComponent, data: {title: 'Über uns'}},
|
|
|
|
{path: 'rxdemo', component: RxDemoComponent, data: {title: 'RxJS Demo'}},
|
2017-03-02 23:26:26 +01:00
|
|
|
{path: 'blog', component: BlogComponent, data: {title: 'Blog'}},
|
2017-04-07 02:55:42 +02:00
|
|
|
{path: 'model-form', component: ModelDrivenFormComponent, data: {title: 'Model Driven Task Form'}},
|
2017-03-02 23:26:26 +01:00
|
|
|
|
2017-04-07 04:09:28 +02:00
|
|
|
{path: 'chat', component: ChatComponent, outlet: 'bottom'},
|
|
|
|
|
2017-02-24 22:54:59 +01:00
|
|
|
{path: 'login', component: LoginComponent},
|
|
|
|
|
|
|
|
{path: 'tasks', canActivate: [LoginGuard], children: tasksRoutes},
|
|
|
|
|
|
|
|
/** Redirect Konfigurationen **/
|
|
|
|
{path: 'tasks/*', redirectTo: '/tasks'},
|
|
|
|
{path: '404', component: NotFoundComponent},
|
|
|
|
|
|
|
|
{path: '**', redirectTo: '/404'}, // immer als letztes konfigurieren - erste Route die matched wird angesteuert
|
|
|
|
];
|
|
|
|
|
|
|
|
export const appRouting = RouterModule.forRoot(appRoutes);
|
|
|
|
|
|
|
|
export const routingComponents = [DashboardComponent, SettingsComponent, AboutComponent, LoginComponent, NotFoundComponent,
|
2017-04-07 04:09:28 +02:00
|
|
|
RxDemoComponent, ModelDrivenFormComponent, ChatComponent, ...blogRoutingComponents, ...tasksRoutingComponents];
|
2017-02-24 22:54:59 +01:00
|
|
|
|
2017-04-07 04:09:28 +02:00
|
|
|
export const routingProviders = [LoginGuard, ...modelDrivenFormRoutingProviders,
|
2017-03-02 23:26:26 +01:00
|
|
|
...tasksRoutingProviders];
|