考虑使用一个TypeScript变量,它可以有几种数据类型之一。interface Human {}
public coatColor: string;现在,在我的Angular在组件代码中,我可以使用显式转换((individual as Dog).coatColor)或,但是Angular模板代码呢?
代码片段如下: private mDialog: MatDialog,msg = "I love Angular.\r\n I want to code typescript."message:msg alert (msg);
mDialog.open(ABCCustomDialogComponent, dialog); 当我尝试警告字符串它在警告消息窗口中显示换行符,如下所示: I love Angul