-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I have a dropdown that get's pre-populated with default first value from the options, when the form is created it's empty all values are null but then inputs$ that I am using from ngx-sub-form on subscribe are populated with the dropdown values so the form becomes pristine:false and the form is marked as dirty, I am not clear how to fix it. Thank you
initControlWithOptions() {
if (this.autoDisplayFirst && this.options && this.options.length > 0 && this.control) {
const firstOptionValue = this.optionValue ? this.options[0][this.optionValue] : this.options[0];
this.control.patchValue(firstOptionValue, { emitEvent: true });
}
}
Angular version: 17
For Tooling issues:
- Node version: v18.17.0
- Platform: Mac
Metadata
Metadata
Assignees
Labels
No labels