Skip to content

Commit 4c2866d

Browse files
committed
first step
1 parent 242f28c commit 4c2866d

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

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

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>flight-search works!</p>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { FlightSearchComponent } from './flight-search.component';
4+
5+
describe('FlightSearchComponent', () => {
6+
let component: FlightSearchComponent;
7+
let fixture: ComponentFixture<FlightSearchComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [FlightSearchComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(FlightSearchComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Component, inject } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { HttpClient } from '@angular/common/http';
4+
import { Flight } from '../model/flight';
5+
6+
@Component({
7+
selector: 'app-flight-search',
8+
standalone: true,
9+
imports: [CommonModule],
10+
templateUrl: './flight-search.component.html',
11+
styleUrls: ['./flight-search.component.css'],
12+
})
13+
export class FlightSearchComponent {
14+
from = '';
15+
to = '';
16+
flights: Array<Flight> = [];
17+
selectedFlight: Flight | undefined;
18+
19+
private http = inject(HttpClient);
20+
21+
ngOnInit(): void {}
22+
23+
search(): void {
24+
// Method body will be implemented later
25+
}
26+
27+
select(f: Flight): void {
28+
this.selectedFlight = f;
29+
}
30+
}

src/app/model/flight.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface Flight {
2+
id: number;
3+
from: string;
4+
to: string;
5+
date: string;
6+
delayed: boolean;
7+
}

0 commit comments

Comments
 (0)