弹出关闭按钮在angular6中不起作用?

时间:2018-08-02 11:16:18

标签: html angular typescript popup angular6

我在此处附加了弹出框代码。此处的关闭按钮不起作用。我对angular 6完全陌生。有人可以帮助我吗?

<!-- Modal Header -->
<div class="modal-header">
  <h4 class="modal-title">selection</h4>
</div>
<form>
<!-- Modal body -->
<div class="modal-body">
    <h5>Enter value:</h5>
    <div class="form-group">
        <input name="Id" type="text" class="form-control shadow-sm" placeholder="Enter value">
    </div>
    <div class="form-group">
        <input name="name" type="text" class="form-control shadow-sm" placeholder="Enter name">
    </div>
</div>
<!-- Modal footer -->
<div class="modal-footer">
    <button type="button" class="btn btn-cancel shadow-sm" data-dismiss="modal">CLOSE</button>
    <button type="submit" class="btn btn-submit shadow-sm">SUBMIT</button>
</div>

1 个答案:

答案 0 :(得分:4)

尝试一下:

 import { DataModalComponent } from './patient-modal/patient-modal.component';
    import { NgbModal, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';


     let ngbModalOptions: NgbModalOptions = {
          backdrop : 'static',
          keyboard : false,
          size: "lg"
        }; 
        const modalRef = this.modalService.open(DataModalComponent ,ngbModalOptions);