我在此处附加了弹出框代码。此处的关闭按钮不起作用。我对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>
答案 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);