-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular valuechanges #567
Labels
invalid
This issue is out of scope or has been deemed invalid
Comments
Another example ngOnInit(){
} saveChages(): void { //saving the changes } saveChagesCity(): void { //saving the changes business logic only for city } QUESTION: In the above code, as soon as I change the city, both method is being called which I don't want it. |
This has nothing to do with this repository or module. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The text was updated successfully, but these errors were encountered: