Here is the object I am working with:
Value {
name: string,
mode: number,
}
I have a text input:
<input type="text" formControlName="valueField">
When enters text into the input, it needs to set the mode also.
If the user enters "OOS" into the text field, the mode should be set to 1.
If the user enters "NMS" into the text field, the mode should be set to 2.
If the user enters anything else - including nothing, the mode should be set to 0.
Also, if this formControlName has a value on page load, the value displays as [object, Object] as it is bound to the entire object.
When the object only has the name property populated, it displays fine.
What I want to achieve is the ability for the user to enter in the string value, and have this set the object, but it also must work with a two-way binding.