方法一:
app.module.ts
import {
ModalModule} from 'ngx-bootstrap/modal';
ModalModule.forRoot()
app.component.html
<button class="btn btn-outline-primary" (click)="myModal.show()">模态框</button>
<div bsModal #myModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-primary" role="document">