info-formas-pago.component.ts 779 Bytes
import { Component, OnInit, TemplateRef, OnDestroy } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';

@Component({
  selector: 'app-formas-pago',
  templateUrl: './info-formas-pago.component.html',
  styleUrls: ['./info-formas-pago.component.scss']
})
export class InfoFormasPagoComponent implements OnInit, OnDestroy {
  mediaPantalla = false;
  timer: any;

  constructor(
    private modalService: BsModalService,
  ) { }

  ngOnInit() { }

  ngOnDestroy() {
    if (this.timer) clearTimeout(this.timer);
  }

  openGoCaja(templateRef: TemplateRef<any>) {
    let modalRef = this.modalService.show(templateRef, { class: 'modal-promo modal-sm modal-dialog-centered' });
    this.timer = setTimeout(() => {
      modalRef.hide();
    }, 3000);
  }
}