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-options', templateUrl: './service-options.html' }) export class DemoModalServiceOptionsComponent { modalRef: BsModalRef; config = { animated: true, keyboard: true, backdrop: true, ignoreBackdropClick: false }; constructor(private modalService: BsModalService) {} openModal(template: TemplateRef) { this.modalRef = this.modalService.show(template, this.config); } openModalWithClass(template: TemplateRef) { this.modalRef = this.modalService.show( template, Object.assign({}, this.config, { class: 'gray modal-lg' }) ); } }