If I have an element in my template which is using property binding, bound to an observable, using async pipe to ensure it is unsubscribed automatically...then would using takeUntil(this.destroy$) be unnecessary?
Template snippet:
<input name="SomeElement"
[ngModel]="boundObservable$ | async">
</input>
Component:
export class MyComponent implements OnDestroy {
destroy$: Subject<any> = new Subject<any>();
boundObservable$ = this.sourceObservable$.pipe(
takeUntil(this.destroy$),
map(this.transformData)
);
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}