I have an Angular form built using Reactive Forms. The form contains 3 select elements. I want to add the value change detection to one dropdown and other two will change accordingly to the values of the first dropdown. Between Change() and valueChanges.subscribe, which will be the best to use and what is the difference.
Angular Dropdown Change() vs valueChanges.subscribe
1.4k views Asked by this_is_akm At
2
They are fundamentally the same thing, each time the value of your dropdown changes, a function that change the value of the two other dropdowns is executed.
valueChangesis an Observable, you have to unsubscribe from it at some point, for instance when the component is destroyed.