Skip to content

Commit 2356f76

Browse files
fix: routing
1 parent 3940ea0 commit 2356f76

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

src/app/app.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
<app-footer></app-footer>
2-
1+
<div class="sytivities">
2+
<router-outlet></router-outlet>
3+
<app-footer></app-footer>
4+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{activity?.name}}
12
@if (activity?.media) {
23
<img [src]="activity?.media.file?.[0].url" alt="{{activity?.name}} Bild">
34
}
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {AsyncPipe} from "@angular/common";
2+
import {AirtableService} from "../../services/airtable.service";
3+
import {AsyncPipe, NgStyle} from "@angular/common";
4+
import {Activity} from "../../types/activity.interface";
35
import {ActivatedRoute, RouterLink} from "@angular/router";
4-
import { AirtableService } from '../../services/airtable.service';
5-
import { Activity } from '../../types/activity.interface';
66

77
@Component({
88
selector: 'app-detail',
99
standalone: true,
1010
imports: [
1111
AsyncPipe,
12-
RouterLink
12+
RouterLink,
13+
NgStyle
1314
],
1415
templateUrl: './detail.component.html',
1516
styleUrl: './detail.component.scss'
1617
})
1718
export class DetailComponent implements OnInit {
18-
19-
activity: Activity | null = null
19+
activity: Activity | null = null;
2020

2121
constructor(
22-
private route: ActivatedRoute,
22+
private route: ActivatedRoute,
2323
private activityService: AirtableService
2424
) {}
25+
2526
ngOnInit(): void {
26-
const osmId = this.route.snapshot.paramMap.get('osm_id');
27+
const osmId = this.route.snapshot.paramMap.get('osm_id');
2728
if (osmId) {
28-
this.activityService.getActivitiesByOsmId(osmId).subscribe ((activities)=>{
29-
this.activity = activities[0]
30-
})
29+
this.activityService.getActivitiesByOsmId(osmId).subscribe((activities) => {
30+
this.activity = activities[0];
31+
});
3132
}
3233
}
3334
}

src/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<title></title>
5-
4+
<meta charset="utf-8">
5+
<title>Sytivities</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="icon" type="image/x-icon" href="assets/favicon.ico">
69
</head>
710
<body>
811
<app-root></app-root>

0 commit comments

Comments
 (0)