Skip to content

Commit 94ff6db

Browse files
committed
feat: implement routing with NoTaskComponent and update app structure
1 parent 2f66435 commit 94ff6db

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

14-routing/01-starting-project/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<app-users />
55

66
<div>
7-
<p>Todo ...</p>
7+
<router-outlet></router-outlet>
88
</div>
99
</main>

14-routing/01-starting-project/src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { Component } from '@angular/core';
22

33
import { HeaderComponent } from './header/header.component';
44
import { UsersComponent } from './users/users.component';
5+
import { RouterOutlet } from '@angular/router';
56

67
@Component({
78
selector: 'app-root',
89
standalone: true,
910
templateUrl: './app.component.html',
1011
styleUrl: './app.component.css',
11-
imports: [HeaderComponent, UsersComponent],
12+
imports: [HeaderComponent, UsersComponent, RouterOutlet],
1213
})
1314
export class AppComponent {}

14-routing/01-starting-project/src/app/app.routes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { Routes } from "@angular/router";
22
import { TaskComponent } from "./tasks/task/task.component";
3+
import { NoTaskComponent } from "./tasks/no-task/no-task.component";
34

45
export const routes: Routes = [
6+
{
7+
path: '',
8+
component: NoTaskComponent
9+
},
510
{
611
path: 'tasks',
712
component: TaskComponent

0 commit comments

Comments
 (0)