AW-6410 Add beforeLocationBack event
This commit is contained in:
parent
349a76395b
commit
31f9b48bd7
@ -1,5 +1,5 @@
|
|||||||
import {Component, HostListener} from '@angular/core';
|
|
||||||
import { Location } from "@angular/common";
|
import { Location } from "@angular/common";
|
||||||
|
import { Component, EventEmitter, HostListener, Output } from '@angular/core';
|
||||||
import { DeviceService } from '../../services/device.service';
|
import { DeviceService } from '../../services/device.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -8,16 +8,18 @@ import { DeviceService} from '../../services/device.service';
|
|||||||
styleUrls: ['./back-button.component.scss']
|
styleUrls: ['./back-button.component.scss']
|
||||||
})
|
})
|
||||||
export class BackButtonComponent {
|
export class BackButtonComponent {
|
||||||
|
@Output() beforeLocationBack = new EventEmitter();
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onBackClicked() {
|
onBackClicked() {
|
||||||
|
this.beforeLocationBack.emit();
|
||||||
this.location.back();
|
this.location.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private location: Location,private deviceService:DeviceService) { }
|
constructor(private location: Location,private deviceService:DeviceService) {
|
||||||
|
}
|
||||||
|
|
||||||
public show() {
|
public show() {
|
||||||
return !this.deviceService.IsMobile();
|
return !this.deviceService.IsMobile();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user