我有一个包含很多文件的大项目。
现在我想用
strictTemplates
,所以我在里面添加了如下几行:
...
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictTemplates": true
...
现在我想禁用(或覆盖)某些
strictTemplates
文件的html-template
规则。最好直接在文件中。
类似的东西:
// pseudo code
<!-- @ignore-strictTemplate -->
有办法做到这一点吗?
ThisAngular 指南页面 对我一点帮助都没有。
According to angular documentation 您可以在某些上下文中使用 $any() 类型转换函数来选择不对表达式的一部分进行类型检查。