title: Why does this for loop cycle through elements not specified?
body: <p>I'm creating a checklist with items and subitems. I have a button to reset all checkboxes and I need to check if the items are all checked, but NOT the subitems.</p>
  
  <p>But my checking code logs ALL the checklist boxes, not just the items. </p>
  
  <p>Here is the template:</p>
  
  <pre><code>&lt;ion-list&gt;
        &lt;ion-item *ngFor='let listitem of checkdetail.contents; let i=index'&gt;
          &lt;ion-label class="mainitem" *ngIf="listitem.flavour === 'item'" text-wrap&gt;{{listitem.content}}&lt;/ion-label&gt;
          &lt;ion-checkbox color="primary" checked="false" *ngIf="listitem.flavour === 'item'" [(ngModel)]="item_ticks[i]" (ionChange)="updateTicks()"&gt;&lt;/ion-checkbox&gt;
  
          &lt;ion-label class="subitem" *ngIf="listitem.flavour === 'subitem'" text-wrap&gt;{{listitem.content}}&lt;/ion-label&gt;
          &lt;ion-checkbox color="secondary" checked="false" *ngIf="listitem.flavour === 'subitem'" [(ngModel)]="subitem_ticks[i]" &gt;&lt;/ion-checkbox&gt;
        &lt;/ion-item&gt;
      &lt;/ion-list&gt;
  </code></pre>
  
  <p>And here is the code:</p>
  
  <pre><code>item_ticks = [];
      subitem_ticks = [];
  
      updateTicks() {
          for(var item of this.item_ticks){
              console.log(item);
          }
      }
  
      resetTicks() {
          let alert = this.alertCtrl.create({
              title: 'Reset?',
              message: 'Are you sure?',
              buttons: [
                {
                  text: 'Cancel',
                  role: 'cancel',
                  handler: () =&gt; {
                    console.log('Cancel clicked');
                  }
                },
                {
                  text: 'Reset',
                  handler: () =&gt; {
                      for (var i = 0; i &lt; this.item_ticks.length; i++){
                          this.item_ticks[i] = false;
                      }   
                      for (var i = 0; i &lt; this.subitem_ticks.length; i++){
                          this.subitem_ticks[i] = false;
                      }
                      let toast = this.toastCtrl.create({
                        message: 'Checklist reset',
                        duration: 1000,
                        position: 'top'
                      });
                      toast.present();
                  }
                }
              ]
            });
            alert.present();
      }
  </code></pre>
  
  <p>Why does the loop in updateTicks() log out both the this.item_ticks AND this.subitem_ticks?</p>