AW-6410 Add beforeLocationBack event

This commit is contained in:
Peter (extern) 2024-10-22 14:38:17 +02:00
parent 349a76395b
commit 31f9b48bd7

View File

@ -1,6 +1,6 @@
import {Component, HostListener} from '@angular/core';
import {Location} from "@angular/common";
import { DeviceService} from '../../services/device.service';
import { Location } from "@angular/common";
import { Component, EventEmitter, HostListener, Output } from '@angular/core';
import { DeviceService } from '../../services/device.service';
@Component({
selector: 'fm-back-button',
@ -8,16 +8,18 @@ import { DeviceService} from '../../services/device.service';
styleUrls: ['./back-button.component.scss']
})
export class BackButtonComponent {
@Output() beforeLocationBack = new EventEmitter();
@HostListener('click')
onBackClicked() {
this.beforeLocationBack.emit();
this.location.back();
}
constructor(private location: Location,private deviceService:DeviceService) { }
constructor(private location: Location,private deviceService:DeviceService) {
}
public show() {
return !this.deviceService.IsMobile();
}
}