I have an union type item like the following:
export interface A {
a: number
}
export interface B {
b: string
}
export type MyUnionType = A | B;
I'd like to check in the template if an object of type MyUnionType is of type A or B based on the presence of the property a or b.
I expected something like this should work:
<div *ngIf="'a' in item">
{{item.a}}
</div>
Any ideas? Thanks!