From 31f9b48bd750f2c4be858ce5d93e9adbe83eedd3 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Tue, 22 Oct 2024 14:38:17 +0200 Subject: [PATCH] AW-6410 Add beforeLocationBack event --- .../components/back-button/back-button.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/common/src/fm/components/back-button/back-button.component.ts b/projects/common/src/fm/components/back-button/back-button.component.ts index c960942..fd980bc 100644 --- a/projects/common/src/fm/components/back-button/back-button.component.ts +++ b/projects/common/src/fm/components/back-button/back-button.component.ts @@ -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(); } - }