2016-12-27 06:36:38 +08:00
|
|
|
import {ModuleWithProviders} from "@angular/core";
|
2017-06-11 04:32:56 +08:00
|
|
|
import {RouterModule, Routes} from "@angular/router";
|
2016-12-27 06:36:38 +08:00
|
|
|
import {LoginComponent} from "./login/login.component";
|
|
|
|
import {GalleryComponent} from "./gallery/gallery.component";
|
|
|
|
import {AdminComponent} from "./admin/admin.component";
|
|
|
|
|
|
|
|
const ROUTES: Routes = [
|
2017-06-11 04:32:56 +08:00
|
|
|
{
|
|
|
|
path: 'login',
|
|
|
|
component: LoginComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'admin',
|
|
|
|
component: AdminComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'gallery/:directory',
|
|
|
|
component: GalleryComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'gallery',
|
|
|
|
component: GalleryComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'search/:searchText',
|
|
|
|
component: GalleryComponent
|
|
|
|
},
|
|
|
|
{path: '', redirectTo: '/login', pathMatch: 'full'}
|
2016-12-27 06:36:38 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
export const appRoutes: ModuleWithProviders = RouterModule.forRoot(ROUTES);
|
|
|
|
|