This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from mcacek/ISSUE-124
ISSUE-100: Add lazy loading of modules
- Loading branch information
Showing
29 changed files
with
274 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
<at-navigation></at-navigation> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { | ||
CanActivate, | ||
Router | ||
} from '@angular/router'; | ||
|
||
import { IdentityService } from './identity.service'; | ||
|
||
@Injectable() | ||
export class AuthGuard implements CanActivate { | ||
constructor(private identityService: IdentityService, private router: Router) { } | ||
|
||
canActivate() { | ||
const isAuthenticated = this.identityService.user.authenticated; | ||
|
||
if (isAuthenticated) { | ||
return true; | ||
} else { | ||
// The original URL that the user intends to access is not stored by this approach. | ||
this.router.navigate(['/login']); | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
<div class="nav-toolbar"> | ||
<md-toolbar color="primary"> | ||
Angular Timesheets | ||
<div class="main-container"> | ||
<div class="nav-toolbar"> | ||
<md-toolbar color="primary"> | ||
<button md-icon-button (click)="sidenav.toggle()" *ngIf="user.authenticated"> | ||
<md-icon>menu</md-icon> | ||
</button> | ||
Angular Timesheets | ||
|
||
<span class="nav-fill-remaining"></span> | ||
<span class="nav-fill-remaining"></span> | ||
<ng-container *ngIf="user.authenticated"> | ||
<span>{{user?.name.first}} {{user?.name.last}}</span> | ||
<button md-icon-button [mdMenuTriggerFor]="menu"> | ||
<md-icon>more_vert</md-icon> | ||
</button> | ||
<md-menu #menu="mdMenu"> | ||
<button md-menu-item (click)="logout()"> | ||
<md-icon>exit_to_app</md-icon> | ||
<span>Logout</span> | ||
</button> | ||
</md-menu> | ||
</ng-container> | ||
</md-toolbar> | ||
</div> | ||
<md-sidenav-container class="side-nav-container"> | ||
<md-sidenav #sidenav class="side-nav-content" mode="side"> | ||
<ul class="side-nav-items"> | ||
<li class="side-nav-item"> | ||
<a routerLink="/projects">Projects</a> | ||
</li> | ||
<li class="side-nav-item"> | ||
<a routerLink="/timesheets">Timesheets</a> | ||
</li> | ||
<li class="side-nav-item"> | ||
<a routerLink="/employees">Employees</a> | ||
</li> | ||
</ul> | ||
</md-sidenav> | ||
|
||
<span>{{user.name.first}} {{user.name.last}}</span> | ||
<button md-icon-button [mdMenuTriggerFor]="menu"> | ||
<md-icon>more_vert</md-icon> | ||
</button> | ||
<md-menu #menu="mdMenu"> | ||
<button md-menu-item (click)="logout()"> | ||
<md-icon>exit_to_app</md-icon> | ||
<span>Logout</span> | ||
</button> | ||
</md-menu> | ||
</md-toolbar> | ||
</div> | ||
<div class="main-container"> | ||
<router-outlet></router-outlet> | ||
<div class="example-sidenav-content"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</md-sidenav-container> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
ng-client/src/app/employee/employee-root/employee-root.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<router-outlet></router-outlet> |
12 changes: 12 additions & 0 deletions
12
ng-client/src/app/employee/employee-root/employee-root.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { | ||
Component, | ||
OnInit | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
templateUrl: './employee-root.component.html' | ||
}) | ||
export class EmployeeRootComponent implements OnInit { | ||
constructor() {} | ||
ngOnInit() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
ng-client/src/app/project/project-root/project-root.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<router-outlet></router-outlet> |
Oops, something went wrong.