我是angular (TypeScript)的新手,我想实现两个类之间的合成。我怎样才能做到这一点呢?在c#中,如果我有像A和B这样的两个类,那么我实现如下的组合{ List<B> lstClassB {get;set;} int ID {get;set;}如何在TypeScript中使用此功能,如{ lstClassB
考虑使用一个TypeScript变量,它可以有几种数据类型之一。interface Human {}
public coatColor: string;现在,在我的Angular模板代码中,我尝试访问对象属性individual.coatColor。那么,即使只存在于几种适用的数据类型中的一种上,我如何仍然访问对象的属性呢?在组件代码中,我可以使用显式转换((individual as Do