Note: since the problem is a little complex, the code is abstracted for readability
We have a <child-component> component template like this:
<select name="someName" #someID ngDefaultControl [(ngModel)]="someModel" (ngModelChange)="onChange(someID.value)">
      <option *ngFor="let a of list" [ngValue]="a.key">{{a.value}}</option>
</select>
And the ts file is with output configuration:
@Component({
  moduleId: module.id,
  selector: 'child-component',
  templateUrl: 'child-component.html',
  outputs: ['someChildEvent']
})
export class ChildComponent {
  someChildEvent = new EventEmitter<string>();
  onChange(value) {
    this.someChildEvent.emit(value);
  }
}
Which we're calling in a <parent-component> like this:
<form #f="ngForm" (submit)="submit(f)" >
<child-component (childEvent)="childData=$event"></child-component>
<input type="submit" value="submit">
</form>
with .ts like:
export class ParentComponent {
    childData;
    submit(f) {
        //How to access childData here?
    }
}
- Is it the correct implementation of the output configuration in Angular 2?
- How do we access the value of the select'soptionfrom<child-component>on<parent-component>'sformsubmit tosubmit(f)function?
 
    