Does one need to unsubscribe from event based on control.
HTMLInput:
const blur$ = fromEvent(formEle, 'blur').subscribe(x => {
this.focused = false;
});
FormGroup:
const valChanges$ = this.fGroupRef.get('first_name').valueChanges.subscribe(val => {
this.hasValue = !!val;
});
Seeking a deeper understanding of what is going on here:
Both of these subscriptions are based upon the events of controls that will be destroyed when navigating away from the control. Will the subscription not unsubscribe as it will refer to nothing? ―OR― does the subscription itself create a reference to said control making it impossible to garbage collect?
Update forgot to mention: In my testing I have found that blur$ is undefined after component destruction, and will thrown an error if unsubscribed. However, valChanges$.unsubscribe() does not throw an error, yet they are both part of the same component.