Skip to content

Commit 31fd5cb

Browse files
RouterLinks update
1 parent 7c7a1f0 commit 31fd5cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/app/app.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="container mx-auto flex justify-between items-center">
33
<a href="#" class="text-white text-2xl font-semibold">Logo</a>
44
<ul class="flex space-x-4">
5-
<li><a href="/" class="text-white hover:text-gray-300">Home</a></li>
6-
<li><a href="/about" routerLink="/about" class="text-white hover:text-gray-300">About</a></li>
7-
<li><a href="/services" class="text-white hover:text-gray-300">Services</a></li>
8-
<li><a href="/contact" class="text-white hover:text-gray-300">Contact</a></li>
5+
<li><a href="javascript:void(0)" routerLink="/" class="text-white hover:text-gray-300">Home</a></li>
6+
<li><a href="javascript:void(0)" routerLink="/about" class="text-white hover:text-gray-300">About</a></li>
7+
<li><a href="javascript:void(0)" routerLink="/services" class="text-white hover:text-gray-300">Services</a></li>
8+
<li><a href="javascript:void(0)" routerLink="/contact" class="text-white hover:text-gray-300">Contact</a></li>
99
</ul>
1010
</div>
1111
</nav>

src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Component } from '@angular/core';
2-
import { RouterOutlet } from '@angular/router';
2+
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
33

44
@Component({
55
selector: 'app-root',
66
standalone: true,
7-
imports: [RouterOutlet],
7+
imports: [RouterOutlet, RouterLink, RouterLinkActive],
88
templateUrl: './app.component.html',
99
styleUrl: './app.component.css'
1010
})

0 commit comments

Comments
 (0)