confirmacion.component.ts
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Component, OnInit, HostListener } from '@angular/core';
import { ArticuloService } from 'src/app/services/articulo/articulo.service';
import { IArticulo } from 'src/app/interfaces/IArticulo';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service';
import { Subject } from 'rxjs';
@Component({
selector: 'app-confirmacion',
templateUrl: './confirmacion.component.html',
styleUrls: ['./confirmacion.component.scss']
})
export class ConfirmacionComponent implements OnInit {
onClose: Subject<any>;
constructor(
public modalRef: BsModalRef,
private inactiveScreen: InactiveScreenService,
) {
this.onClose = new Subject();
}
ngOnInit() {
}
confirmarArticulo() {
this.onClose.next();
this.modalRef.hide();
}
close() {
this.modalRef.hide();
}
@HostListener('document:click', ['$event'])
eventListener(event: Event) {
clearTimeout(this.inactiveScreen.timerReposo);
this.inactiveScreen.startTimeOutInactividad();
}
}