43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { Location } from '@angular/common';
|
|
import { GeomonPlatform } from '../../../shared/models/platform';
|
|
import { DatasetApiService } from '../../services/dataset-api.service';
|
|
|
|
// import { Hero } from '../hero';
|
|
// import { HeroService } from '../hero.service';
|
|
|
|
@Component({
|
|
selector: 'geomon-platform-detail',
|
|
templateUrl: './platform-detail.component.html',
|
|
styleUrls: ['./platform-detail.component.scss']
|
|
})
|
|
export class PlatformDetailComponent implements OnInit {
|
|
|
|
platform: GeomonPlatform;
|
|
|
|
constructor(
|
|
private route: ActivatedRoute,
|
|
private datasetService: DatasetApiService,
|
|
private location: Location
|
|
) {}
|
|
|
|
ngOnInit(): void {
|
|
this.getHero();
|
|
}
|
|
|
|
getHero(): void {
|
|
const id = String(this.route.snapshot.paramMap.get('id'));
|
|
this.datasetService.getPlatform(id, 'https://geomon.geologie.ac.at/52n-sos-webapp/api/')
|
|
.subscribe((platform) => {
|
|
this.platform = platform;
|
|
});
|
|
|
|
|
|
}
|
|
|
|
goBack(): void {
|
|
this.location.back();
|
|
}
|
|
|
|
}
|