Skip to content

Commit 4959e68

Browse files
author
Your Name
committed
Angular Router Course
1 parent 040b175 commit 4959e68

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/app/app-routing.module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {AboutComponent} from './about/about.component';
55
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
66
import {CanLoadAuthGuard} from './services/can-load-auth.guard';
77
import {CustomPreloadingStrategy} from './services/custom-preloading.strategy';
8+
import {ChatComponent} from './chat/chat.component';
89

910

1011
const routes: Routes = [
@@ -30,6 +31,11 @@ const routes: Routes = [
3031
path: "about",
3132
component: AboutComponent
3233
},
34+
{
35+
path: 'helpdesk-chat',
36+
component: ChatComponent,
37+
outlet: 'chat'
38+
},
3339
{
3440
path: "**",
3541
component: PageNotFoundComponent

src/app/app.component.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
</div>
2626

27-
<a mat-button class="menu-item" *ngIf="auth.isLoggedIn$ | async">
27+
<a mat-button class="menu-item" *ngIf="auth.isLoggedIn$ | async"
28+
[routerLink]="[{outlets: {chat: ['helpdesk-chat']}}]">
2829
<mat-icon>help</mat-icon>
2930
</a>
3031

@@ -54,3 +55,12 @@
5455

5556
</mat-sidenav-container>
5657

58+
<router-outlet name="chat"></router-outlet>
59+
60+
61+
62+
63+
64+
65+
66+

src/app/chat/chat.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.chat-container {
44
position: fixed;
5-
bottom: 10px;
5+
bottom: 70px;
66
right: 10px;
77
height: 300px;
88
width: 500px;

0 commit comments

Comments
 (0)