Implemented basic home screen which ensures a user is logged in or if an admin is created. Added admin module with route guard to ensure only admins get through, but it's not working.
This commit is contained in:
parent
5d31b050b0
commit
8fba679788
36 changed files with 1156 additions and 627 deletions
|
|
@ -1,7 +1,18 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { HomeComponent } from './home/home.component';
|
||||
import { AdminGuard } from './_guards/admin.guard';
|
||||
|
||||
const routes: Routes = [];
|
||||
const routes: Routes = [
|
||||
{path: '', component: HomeComponent},
|
||||
{
|
||||
path: 'admin',
|
||||
runGuardsAndResolvers: 'always',
|
||||
canActivate: [AdminGuard],
|
||||
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule)
|
||||
},
|
||||
{path: '**', component: HomeComponent, pathMatch: 'full'}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue