import { Location } from '@angular/common'; import { Component } from '@angular/core'; import { MqttRequestService } from './Service/Mqtt/mqtt-request.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) export class AppComponent { header: string; constructor(private mqttRequestService: MqttRequestService, private location: Location) { // Header in der Leiste zu bestimmen const actualRoute = this.location.path().slice(1); const lastParam = actualRoute.charAt(0).toUpperCase() + actualRoute.slice(1); if (lastParam === "") { this.onMenuSelect('Home'); } else { this.onMenuSelect(lastParam); } } onMenuSelect(header: string) { this.header = header; } }