angular - Refresh the popup input text in Angular 9
问题描述
I have added a popup for adding the new user activity... with one input box for adding a activity in the popup after submitting the activity the input box is not refreshing ...
need help ... I am new to this
I have below code in component.html
<div class="usermanagement modal fade" id="cloneactivity" tabindex="-3" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<form (ngSubmit)="Addnew()">
<div class="modal-header">
<h4 class="modal-title">User Activity</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Are you sure you want to add the activity?</p>
<!-- <label
class="col-form-label"> :
</label> -->
New activity : <input type="text" class="formControl" Id="newactivity" placeholder=" activity Name">
</div>
<div class="modal-footer">
<input type="button" class="btn-cancel" data-dismiss="modal" #closecloneResourceModal
value="Cancel">
<input type="submit" class="btn-submit" value="Clone">
</div>
</form>
and in Addnew()
Addnew() {
console.log(" user ID :" + this.userId);
this.onaddnewactivity(this.userId);
this.closeResourceModal.nativeElement.click();
}
解决方案
推荐阅读
- javascript - 如何检测IOS是否已经安装了PWA
- git - 如何为 lcoal git (github) 存储库永久添加 SSH 密钥?
- python - PEM 编码中 ECC 私钥的 Python 导入失败
- python - Python IDLE多语句错误是shell模式
- java - 如何在 Java 中将字符串拆分为 2 部分?
- android - 找不到“com.afollestad:material-dialogs:0.7.9.1”
- c# - 启动多个阻塞任务的奇怪行为
- list - 如何使 switch.toggle() 在 ForEach 循环中生效?
- cufflinks - 袖扣消除烛台图表中的空白
- meteor - 如何在流星中接收辅助函数的承诺值?