I have 5 form controls inside the formgroup and I have subscribed the valueChanges method on formGroup.
How can I opt out one formControl from that formGroup not to subscribe with valueChanges? because I have separated logic for that control and that logic will take care all the required things.
Example:
this.myForm = this.fb.group({
id: [, { updateOn: 'change' }],
name: [, { updateOn: 'change' }]
})
this.myForm.valueChanges.subscribe(x=> this.saveChages());
But let's say from the above subscription what if I want to opt out name?
FYI: I would like to avoid subscription for each and every control separately. It led to increase the lines of code so.
Thanks in advance.
Dhimant
I have 5 form controls inside the formgroup and I have subscribed the valueChanges method on formGroup.
How can I opt out one formControl from that formGroup not to subscribe with valueChanges? because I have separated logic for that control and that logic will take care all the required things.
Example:
this.myForm = this.fb.group({
id: [, { updateOn: 'change' }],
name: [, { updateOn: 'change' }]
})
this.myForm.valueChanges.subscribe(x=> this.saveChages());
But let's say from the above subscription what if I want to opt out name?
FYI: I would like to avoid subscription for each and every control separately. It led to increase the lines of code so.
Thanks in advance.
Dhimant