嗨,我正在使用角度为9的Bootstrap 4实际上,这是一个模型,当我按下“提交”按钮时,该模型将不会关闭。我希望数据通过,然后关闭模式
<form class="col-lg-6 offset-lg-3 " #addAddressForm="ngForm" (ngSubmit)="onSubmitAddress(addAddressForm.value)">
<div class="form-group ">
<label for="inputAddress">Name</label>
<input type="text" class="form-control forms1" id="" placeholder="" name="addressName" ngModel>
</div>
<div class="form-group ">
<label for="inputAddress2">Last name</label>
<input type="text" class="form-control " id="" placeholder="" name="addressIP" ngModel>
</div>
<div class="modal-footer d-flex justify-content-center">
<button type="submit" class="btn btn-primary"> Submit </button>
</div>
</form>
如果未使用任何ui角度库而使用模态,则使用Viewchild元素,将#modelName
放到模态关闭按钮元素中>]
<button #modelName type="button" class="close" aria-label="Close" (click)="d('Cross click')">
<span aria-hidden="true">×</span>
</button>