Within my template, I have implemented an async pipe for input binding using a union type variable :
<app-mycomponent *ngSwitchCase="'myType'" [target]="myVar| async"></app-mycomponent>
The variable myVar can be either of type Observable or string.
@Input() myVar!: Observable<blabla>[]> | string;
However, I am encountering the following error :
Argument of type 'string | Observable<blabla[]>' is not assignable to parameter of type 'Observable<blabla[]> | Subscribable<blabla[]> | Promise<blabla[]>'.
Is there a way to properly cast my variable in order to successfully pass it through the async pipe?