Is it possible to ensure that a specific type of object instance passed through @Input()
extends from a shared interface?
Currently, I am using:
@Input()
associatedObject: IDocument | IOrganization;
It would be more ideal if we could do something like this:
@Input()
associatedObject: <T extends ICommonInterface>;
This way, there is no need to constantly add new types in the future as long as the instance passes the interface verification.