简体   繁体   English

提交表单时如何关闭ngboostrap模型?

[英]How to close ngboostrap model while submiting the form?

How to close ngbootstrap model along with form submission inside the model window. 如何在模型窗口中关闭ngbootstrap模型以及表单提交。 I am using angular 6. 我正在使用角度6。

In the submit button, call the close function 在提交按钮中, 调用关闭功能

<button  (click)="d('Cross click')">Submit</button>

Or bind it with submit event 其与Submit事件绑定

import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';

....

constructor(private modalService: NgbModal) {}

submit() {
   const modalRef = this.modalService.close(NgbdModalContent);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM