I've been attempting to connect an input to a form control. Here's the code snippet for the input:
<input [(ngModel)]="someProperty" ngControl="someProperty">
And in the component file:
someProperty: Control;
someForm:ControlGroup;
...
constructor(private _form_builder: FormBuilder){
this.someProperty = new Control('', Validators.required);
this.someForm = this._form_builder.group({
someProperty:this.someProperty
});
}
However, when I run the application, my input field displays [object Object]
, indicating that something isn't quite right with the binding. What is the correct way to accomplish this? Shouldn't the controls be able to handle these bindings seamlessly?