lundi 2 octobre 2017

Checbox HTML return somthing after returning true

I have a form and checkbox in form . User check it if he adds an admin. Can I return the checked box in a table after finishing the form ??

<form [formGroup]="addUserForm" (ngSubmit)="onSubmit(f)" #f="ngForm">
      <div class="row">
       <div class="form-group" class="col-lg-12">
        <ul class="flex-outer">
          <li>
             <label for="first-name"> userName </label>
             <input type="text" formControlName="username">
           </li>
           <li>
              <label for="password"> Password </label>
              <input type="password" formControlName="password">
           </li>
           <li>
              <label for="check"> IsAdmin  </label>
              <div class="form-check">
                <label class="form-check-label">
                  <input type="checkbox" class="form-check-input" formControlName="admin">
                </label>
               </div>
            </li>
         </ul>
        </div> 
      </div>
     <button type="submit" class="btn btn-success" (click)="onUserSave(addUserForm.value, f)"> Save </button>
</form>
<table class="table table-hover table-condensed text-center">
                    <thead>
                        <tr>
                            <th> UserName </th>
                            <th> isAdmin </th>  <!-- i want to add checked box here or any thing declare that it's checked -->
                            <th> Employee </th> 
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let user of users">
                            <td>  </td>
                            <td> </td>
                            <td> </td>
                        </tr>
                    </tbody>

If user check is admin in form , it returns true in table . I want to make it checked box .. Can i ?




Aucun commentaire:

Enregistrer un commentaire