In Angular 4, I\'m trying to subscribe to the valueChanges of a FormControl. Neither of the versions below is working. I\'m not seeing any errors. The form.value JSON is upd
I gave up on FormGroup and FormBuilder and just used
HTML:
App class:
firstName = new FormControl();
ngOnInit:
this.firstName.valueChanges.subscribe(value => {
console.log('name has changed:', value)
});
My test is currently broken with the error "No provider for NgControl" but I'll work on that next. Update: I just needed to import ReactiveFormsModule in the TestBed