title: Dynamic Checkbox checked on Edit mode
body: <p>I am unable to checked my check boxes or switch to checked true.</p>
  
  <p>please help on this i couldn't figure where i am doing wrong.</p>
  
  <p>i am using Switch check boxes</p>
  
  <p>i have tried *ngIf condition to show true when i get true record else false</p>
  
  <pre><code>    &lt;table class="table table-stripped table-hover table-responsive-lg"&gt;
                              &lt;thead class="thead-light"&gt;
                                  &lt;!-- &lt;th&gt;Id&lt;/th&gt; --&gt;
                                  &lt;th&gt;Select&lt;/th&gt;
                                  &lt;th&gt;Id&lt;/th&gt;
                                  &lt;th&gt;Page Name&lt;/th&gt;
                                  &lt;th&gt;Page Group&lt;/th&gt;
                                  &lt;!-- &lt;th&gt;Url&lt;/th&gt; --&gt;
                              &lt;/thead&gt;
  
                              &lt;tbody&gt;
                                  &lt;tr *ngIf="roleservice.pagelist.length==0" [class.text-danger]="!isValid &amp;&amp; roleservice.pagelist.length==0"&gt;
                                      &lt;td class="font-italic text-center" colspan="5"&gt;
                                          No records.
                                      &lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr *ngFor="let item of roleservice.pagelist;let i=index;"&gt;
                                      &lt;td&gt;
                                          &lt;div *ngIf="item.ischecked==true"&gt;
                                                  &lt;label class="switch switch-3d switch-primary"&gt;
                                                          &lt;input type="checkbox"   [(ngModel)]="item.ischecked"   value="{{item.PageId}}" checked="true"  name = "ischecked" class="switch-input"&gt;
                                                          &lt;span class="switch-slider"&gt;&lt;/span&gt;
                                                      &lt;/label&gt;
                                          &lt;/div&gt;
  
                                          &lt;div *ngIf="item.ischecked==false"&gt;
                                                  &lt;label class="switch switch-3d switch-primary"&gt;
                                                          &lt;input type="checkbox"   [(ngModel)]="item.ischecked"   value="{{item.PageId}}" checked="false"   name = "ischecked" class="switch-input"&gt;
                                                          &lt;span class="switch-slider"&gt;&lt;/span&gt;
                                                      &lt;/label&gt;
                                          &lt;/div&gt;
  
                                      &lt;/td&gt;
                                      &lt;td&gt;{{item.PageId}}&lt;/td&gt;
  
                                      &lt;td&gt;{{item.PageTitle}}&lt;/td&gt;
                                      &lt;td&gt;{{item.PageGroup}}&lt;/td&gt;
                                  &lt;/tr&gt;
                              &lt;/tbody&gt;
                          &lt;/table&gt;
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    this.roleservice.getAllRolesById(ShareVariables.RoleId).then(res =&gt; {
                  this.roleservice.rolemodel = res;
                  this.roleservice.pagelist = res.PageList;
                  ShareVariables.RoleId = 0;
                  console.log(this.roleservice.rolemodel)
                  console.log(this.roleservice.pagelist)
  
              });</code></pre>
  </div>
  </div>
  </p>
  
  <p>My browser console values <a href="https://i.stack.imgur.com/uAxxP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uAxxP.png" alt="enter image description here"></a></p>