【发布时间】:2018-03-09 23:25:45
【问题描述】:
我遇到了问题,我想帮助我从组件中打开一个模式。 我想在表单中验证用户后打开模式。
.component.html
<ng-template #modalExample let-c="close" let-d="dismiss">
/** Modal body **/
</ng-template>
<form (ngSubmit)="f.form.valid && signin()" #f="ngForm" class="">
/** Buttons, labels, buttons **/
</form>
.component.ts
signin() {
/**Calling backend**/
this.modalService( *REFERENCE TO MODAL HERE* )
}
我试过了
@ViewChild('modalExample') modalExample: ElementRef
this.modalService.open(this.modalExample);
【问题讨论】:
标签: html angular modal-dialog frontend ng-bootstrap