NetanelBasal
4/2/2017 - 7:43 PM

app-input.component.ts

@Component({
  selector: 'app-input',
  template: `
    <input type="text" [formControl]="form" class="form-control">
  `,
})
export class AppInput {
  @Output() value = new EventEmitter();
  form;
  
  ngOnInit() {
    this.form = new FormControl();
    
    this.form.valueChanges.subscribe(val => {
      this.value.next(val);
    });
  }
  
}