首页 > 解决方案 > 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();

     }

标签: angular

解决方案


推荐阅读