Skip to content

Commit

Permalink
setup feature modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sleez007 committed Oct 4, 2022
1 parent 878ec8e commit a129892
Show file tree
Hide file tree
Showing 20 changed files with 241 additions and 524 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To u
## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

ng generate module customers --route customers --module app.module
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@ngrx/effects": "^14.3.1",
"@ngrx/store": "^14.3.1",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
Expand All @@ -35,4 +37,4 @@
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
}
29 changes: 26 additions & 3 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { IsSignedInGuard } from './pages/auth/guard/is-signed-in.guard';
import { HasAccessGuard } from './pages/dashboard/guard/has-access.guard';

const routes: Routes = [];
const routes: Routes = [
{
path: 'auth',
canActivate: [IsSignedInGuard],
loadChildren: () => import('./pages/auth/auth.module').then(m => m.AuthModule)
},
{
path: 'dashboard',
canLoad: [HasAccessGuard],
canActivate: [HasAccessGuard],
loadChildren: () => import('./pages/dashboard/dashboard.module').then(m => m.DashboardModule)
},
{
path: '',
pathMatch: 'full',
redirectTo: 'auth'
},
{
path: '**',
redirectTo:'auth'
}
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, {preloadingStrategy: PreloadAllModules})],
exports: [RouterModule]
})
export class AppRoutingModule { }
Loading

0 comments on commit a129892

Please sign in to comment.