Skip to content

Commit 69726c8

Browse files
committed
add simple template
1 parent d5cd8ed commit 69726c8

File tree

5 files changed

+58
-21
lines changed

5 files changed

+58
-21
lines changed

src/app/app.component.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<div class="wrapper">
2-
32
<div class="sidebar" data-color="white" data-active-color="danger">
4-
<app-sidebar-cmp></app-sidebar-cmp>
3+
<app-sidebar-cmp></app-sidebar-cmp>
54
</div>
65

76
<div class="main-panel">
8-
<app-navbar-cmp></app-navbar-cmp>
7+
<app-navbar-cmp></app-navbar-cmp>
98

10-
<div class="content">
11-
12-
<h1>{{title}}</h1>
13-
14-
</div>
9+
<div class="content">
10+
<h1>{{ title }}</h1>
11+
</div>
1512
</div>
16-
1713
</div>

src/app/app.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { FlightSearchComponent } from './flight-search/flight-search.component';
23
import { NavbarComponent } from './navbar/navbar.component';
34
import { SidebarComponent } from './sidebar/sidebar.component';
45

56
@Component({
67
standalone: true,
7-
imports: [
8-
SidebarComponent,
9-
NavbarComponent,
10-
],
8+
imports: [SidebarComponent, NavbarComponent, FlightSearchComponent],
119
selector: 'app-root',
1210
templateUrl: './app.component.html',
13-
styleUrls: ['./app.component.css']
11+
styleUrls: ['./app.component.css'],
1412
})
1513
export class AppComponent {
1614
title = 'Hello World!';
Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
<p>flight-search works!</p>
1+
<div class="header">
2+
<h2 class="title">Flight Search</h2>
3+
</div>
4+
5+
<form>
6+
<div class="form-group">
7+
<label>From:</label>
8+
<input name="from" class="form-control" />
9+
</div>
10+
<div class="form-group">
11+
<label>To:</label>
12+
<input name="to" class="form-control" />
13+
</div>
14+
15+
<div class="form-group">
16+
<button class="btn btn-default">Search</button>
17+
</div>
18+
</form>
19+
20+
<table class="table table-condensed">
21+
<thead>
22+
<tr>
23+
<th>Id</th>
24+
<th>From</th>
25+
<th>To</th>
26+
<th>Date</th>
27+
<th></th>
28+
</tr>
29+
</thead>
30+
<tbody>
31+
<tr>
32+
<td>...</td>
33+
<td>...</td>
34+
<td>...</td>
35+
<td>...</td>
36+
<td>
37+
<a>Select</a>
38+
</td>
39+
</tr>
40+
</tbody>
41+
</table>
42+
43+
<div *ngIf="selectedFlight">
44+
<pre>{{ selectedFlight | json }}</pre>
45+
</div>

src/app/flight-search/flight-search.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ import { Flight } from '../model/flight';
1111
styleUrls: ['./flight-search.component.css'],
1212
})
1313
export class FlightSearchComponent {
14-
from = '';
15-
to = '';
14+
from = 'London';
15+
to = 'Paris';
1616
flights: Array<Flight> = [];
1717
selectedFlight: Flight | undefined;
1818

1919
private http = inject(HttpClient);
2020

21-
ngOnInit(): void {}
22-
2321
search(): void {
24-
const url = 'http://www.angular.at/api/flight';
22+
const url = 'https://demo.angulararchitects.io/api/flight';
2523

2624
const headers = {
2725
Accept: 'application/json',

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { provideHttpClient } from '@angular/common/http';
12
import { bootstrapApplication } from '@angular/platform-browser';
23
import { AppComponent } from './app/app.component';
34

45
bootstrapApplication(AppComponent, {
5-
providers: [],
6+
providers: [provideHttpClient()],
67
});

0 commit comments

Comments
 (0)