2020-02-08 02:01:00 +00:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
2021-02-15 17:45:04 +00:00
|
|
|
import {LoginPage} from './pages/login/login.page';
|
|
|
|
import {AuthService} from './service/auth.service';
|
|
|
|
import {GuestOnlyGuard} from './service/guard/GuestOnly.guard';
|
2020-02-08 02:01:00 +00:00
|
|
|
|
|
|
|
const routes: Routes = [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
redirectTo: 'home',
|
|
|
|
pathMatch: 'full'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'home',
|
2021-02-15 17:45:04 +00:00
|
|
|
canActivate: [AuthService],
|
2020-02-08 02:01:00 +00:00
|
|
|
loadChildren: () => import('./home/home.module').then(m => m.HomePageModule)
|
|
|
|
},
|
2020-02-08 09:36:14 +00:00
|
|
|
{
|
|
|
|
path: 'editor',
|
2020-11-03 04:33:13 +00:00
|
|
|
loadChildren: () => import('./components/components.module').then( m => m.ComponentsModule)
|
2021-02-15 17:45:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'login',
|
|
|
|
canActivate: [GuestOnlyGuard],
|
|
|
|
component: LoginPage,
|
2020-02-08 02:01:00 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
|
|
|
],
|
|
|
|
exports: [RouterModule]
|
|
|
|
})
|
|
|
|
export class AppRoutingModule {}
|