Skip to content
Loading
  • 0
    Hi Jay,
     
    What changes did you make to my code?
    I just noticed that the opening DIV tags are missing on my post.
     
    1. <div class="form-check" *ngFor="let role of roles">  
    2.     <div class="row">  
    3.         <div class="col-6">  
    4.             <input  
    5.              class="form-check-input"  
    6.              type="checkbox"  
    7.              value="role.name"  
    8.              [checked]="role.checked"  
    9.              />  
    10.              <label>{{ role.name }}label>  
    11.         div>  
    12.     div>  
    13. div>  
     
    0
  • 0
    I just figured it out. I needed to move the ngFor loop from the form-check div to the col-6 div
    1. <div class="form-check">  
    2.           <div class="row">  
    3.             <div class="col-6" *ngFor="let role of availableRoles">  
    4.               <input  
    5.                 class="form-check-input"  
    6.                 type="checkbox"  
    7.                 value="role.name"  
    8.                 [checked]="role.checked"  
    9.               />  
    10.               <label>{{ role.name }}label>  
    11.             div>  
    12.           div>  
    13.         div>  
     
    0