valor-software/angular2-bootstrap

View on GitHub
demo/src/app/components/+modal/demos/service-options/disable-esc-closing/disable-esc-closing.ts

Summary

Maintainability
A
3 hrs
Test Coverage
import { Component, TemplateRef } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';

@Component({
  selector: 'demo-modal-service-disable-esc-closing',
  templateUrl: './disable-esc-closing.html'
})
export class DemoModalServiceDisableEscClosingComponent {
  modalRef: BsModalRef;
  config = {
    keyboard: true
  };
  constructor(private modalService: BsModalService) {}

  openModal(template: TemplateRef<any>) {
    this.modalRef = this.modalService.show(template, this.config);
  }
}