repository to manage all files related to the makeathon farm bot project (Software + Documentation).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.component.ts 783B

12345678910111213141516171819202122232425262728
  1. import { Location } from '@angular/common';
  2. import { Component } from '@angular/core';
  3. import { MqttRequestService } from './Service/Mqtt/mqtt-request.service';
  4. @Component({
  5. selector: 'app-root',
  6. templateUrl: './app.component.html',
  7. styleUrls: ['./app.component.css'],
  8. })
  9. export class AppComponent {
  10. header: string;
  11. constructor(private mqttRequestService: MqttRequestService, private location: Location) {
  12. // Header in der Leiste zu bestimmen
  13. const actualRoute = this.location.path().slice(1);
  14. const lastParam = actualRoute.charAt(0).toUpperCase() + actualRoute.slice(1);
  15. if (lastParam === "") {
  16. this.onMenuSelect('Home');
  17. } else {
  18. this.onMenuSelect(lastParam);
  19. }
  20. }
  21. onMenuSelect(header: string) {
  22. this.header = header;
  23. }
  24. }