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(); } - }