title: Angular2 Parent Component Not Triggering Event of Child Component
body: <p>I am attempting to create a component that allows the user to select actions to be performed on "tests" using a table interface. Each row of the table is a separate child component with the parent component comprising of the table headers and the child component rows, which are created using <code>*ngFor</code>.</p>
  
  <p>Everything is mostly going well, except I need the checkbox in the header to check all of the child component checkboxes and the select in the header to select all of the child component to equal the chosen option in the header. The checkboxes look like it works (as demoed in the Plunker), but the event handler in the parent component does not get the updated checked value when the header checkbox is checked, but does when the actual row's checkbox is checked. The demo has the checkboxes printing stuff to the console. I would expect the header checkbox to trigger all of the checkbox's 'checked' event and print multiple statements to the console (two lines per table row).</p>
  
  <p>I started putting the pieces in place to handle the header's select changing, but am a little stuck as to how to make a select's option selected when the options are being populated using <code>*ngFor</code>.</p>
  
  <p>I don't know if it matters, but I am using angular2-beta 15 and am trying to stay on this version if possible.</p>
  
  <p>Plunker and code dump are below.</p>
  
  <pre><code>import {Component, EventEmitter, Output, Input} from 'angular2/core'
  
  // Child Component
  @Component({
  selector: 'tbody',
  template: `
      &lt;td&gt;{{ test }}&lt;/td&gt;
      &lt;td&gt;
        &lt;select (change)="selectedActionChange($event)"&gt;
          &lt;option *ngFor="#opt of optionList"&gt;{{ opt }}&lt;/option&gt;
        &lt;/select&gt;
      &lt;/td&gt;
      &lt;td class="center"&gt;
        &lt;input type="checkbox" [ngModel]="checkboxValue" (ngModelChange)="checkboxChanged($event)" /&gt;
      &lt;/td&gt;
  `
  })
  
  export class ChildComponent {
    @Input() test: string;
    @Input() checkboxValue: boolean;
    @Input() selectedAction: string;
    @Output() action: EventEmitter&lt;any&gt; = new EventEmitter();
    @Output() checked: EventEmitter&lt;any&gt; = new EventEmitter();
    optionList: Array&lt;string&gt; = ["Add", "Replace", "Skip"];
  
    selectedActionChange(event) {
      this.action.emit({
        value: event.srcElement.value,
        test: this.test
      });
    }
  
    checkboxChanged(event: any) {
          this.checked.emit({
          value: event,
          test: this.test
      });
    }
  
  }
  
  // Parent Component
  @Component({
      selector: 'parent',
      template: `
          &lt;table&gt;
            &lt;thead&gt;
              &lt;tr&gt;
                &lt;th&gt;Test Name&lt;/th&gt;
                &lt;th&gt;
                  &lt;label&gt;Action&lt;/label&gt;
                  &lt;br /&gt;
                 &lt;select (change)="headerSelectChanged($event)"&gt;
                    &lt;option *ngFor="#opt of optionList"&gt;{{ opt }}&lt;/option&gt;
                  &lt;/select&gt;
                &lt;/th&gt;
                &lt;th&gt;
                  &lt;label&gt;Import Test&lt;/label&gt;
                  &lt;br /&gt;
                  &lt;input type="checkbox" checked (change)="headerCheckboxChanged($event)"/&gt;
            &lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody *ngFor="#test of testList" [test]="test" [checkboxValue]="masterCheckboxValue" [selectedAction]="masterSelectAction"
        (action)="actionChange($event)" (checked)="checkedChanged($event)"&gt;&lt;/tbody&gt;
      &lt;/table&gt;
  `,
  directives: [ChildComponent]
  })
  
  export class ParentComponent {
    testList: Array&lt;string&gt; = ["Test 1", "Test 2", "Test 3"];
    optionList: Array&lt;string&gt; = ["Add", "Replace", "Skip"];
    masterCheckboxValue: boolean = true;
    masterSelectAction: string;
  
    headerCheckboxChanged(event: any): void {
      this.masterCheckboxValue = event.srcElement.checked;
    }
  
    headerSelectChanged(event: any): void {
        this.masterSelectAction = event.srcElement.value;
    }
  
    actionChange(event: any) {
      console.log(event.test);
      console.log(event.value);
    }
  
    checkedChanged(event: any) {
      console.log(event.test);
      console.log(event.value);
    }
  }
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/xRfTi7DkEd08KE6PjYnT?p=preview" rel="nofollow"><strong>Plunker</strong> link</a></p>