ng2-validation-manager
ng2-validation-manager copied to clipboard
Cannot set array as value
I am trying to set array values to a field, but its always passed as a string instead of an array.
this.form.setValue({
'request_types': ['hotel', 'flights']
});
@jagadeshanh In your case request_types is formArray right? If so, the issue known, is because currently setValue accepts only string not array or objects, can you submit PR for this?
What was the reason for converting the value to string
this.formGroup.get(values).setValue(value.toString());
I know there was an issue and I solved it with toString() but I don't remember what was the issue! However, change if you can make it work properly.