We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2866d commit d5cd8edCopy full SHA for d5cd8ed
src/app/flight-search/flight-search.component.ts
@@ -21,7 +21,25 @@ export class FlightSearchComponent {
21
ngOnInit(): void {}
22
23
search(): void {
24
- // Method body will be implemented later
+ const url = 'http://www.angular.at/api/flight';
25
+
26
+ const headers = {
27
+ Accept: 'application/json',
28
+ };
29
30
+ const params = {
31
+ from: this.from,
32
+ to: this.to,
33
34
35
+ this.http.get<Flight[]>(url, { headers, params }).subscribe({
36
+ next: (flights) => {
37
+ this.flights = flights;
38
+ },
39
+ error: (errResp) => {
40
+ console.error('Error loading flights', errResp);
41
42
+ });
43
}
44
45
select(f: Flight): void {
0 commit comments