Skip to content

Commit f2bbd2f

Browse files
add routing + command page
1 parent 1714e87 commit f2bbd2f

File tree

9 files changed

+40
-4
lines changed

9 files changed

+40
-4
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[*.{js,ts}]
33
charset = utf-8
44
indent_style = tab
5+
indent_size = 4
56
trim_trailing_whitespace = true
67

78
[package.json]

src/app/app-routing.module.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from "@angular/core";
2+
import { Routes, RouterModule } from "@angular/router";
3+
4+
import { CommandComponent } from "./command/command.component";
5+
6+
const routes: Routes = [
7+
{ path: "command", component: CommandComponent }
8+
];
9+
10+
@NgModule({
11+
imports: [RouterModule.forRoot(routes)],
12+
exports: [RouterModule]
13+
})
14+
export class AppRoutingModule { }

src/app/app.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ <h2>
3030
href="https://blog.angular.io/">Angular blog</a>
3131
</h2>
3232
</li>
33-
</ul>
33+
</ul>
34+
35+
<router-outlet></router-outlet>

src/app/app.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { TestBed, async } from "@angular/core/testing";
2+
import { RouterTestingModule } from "@angular/router/testing";
23
import { AppComponent } from "./app.component";
34
describe("AppComponent", () => {
45
beforeEach(async(() => {
56
TestBed.configureTestingModule({
7+
imports: [
8+
RouterTestingModule
9+
],
610
declarations: [
711
AppComponent
812
],

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ import { Component } from "@angular/core";
77
})
88
export class AppComponent {
99
title = "app";
10-
}
10+
}

src/app/app.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { BrowserModule } from "@angular/platform-browser";
22
import { NgModule } from "@angular/core";
33

4+
import { AppRoutingModule } from "./app-routing.module";
45

56
import { AppComponent } from "./app.component";
7+
import { CommandComponent } from "./command/command.component";
68

79

810
@NgModule({
911
declarations: [
10-
AppComponent
12+
AppComponent,
13+
CommandComponent
1114
],
1215
imports: [
13-
BrowserModule
16+
BrowserModule,
17+
AppRoutingModule
1418
],
1519
providers: [],
1620
bootstrap: [AppComponent]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>{{title}}</h1>

src/app/command/command.component.scss

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from "@angular/core";
2+
3+
@Component({
4+
selector: "app-command",
5+
templateUrl: "./command.component.html",
6+
styleUrls: ["./command.component.scss"]
7+
})
8+
export class CommandComponent {
9+
title = "Command";
10+
}

0 commit comments

Comments
 (0)