20

I have a large project with many files.

Now I want to use strictTemplates, so I added the following lines in:

tsconfig.json

    ...
        "angularCompilerOptions": { 
        "fullTemplateTypeCheck": true, 
        "strictTemplates": true 
    ... 

Now I want to disable (or overwrite) strictTemplates rule for certain html-template files. Preferably direct in the file itself.

Something like:

component.html

// pseudo code
<!-- @ignore-strictTemplate -->

Is there a way to achieve this?

ThisAngular guide page does not help me at all.

Roy
  • 7,811
  • 4
  • 24
  • 47
  • Did you ever get around, I have a similar problem where I have a third party directive that is causing a problem when strict is enabled. Works fine though – KeithMac Dec 13 '22 at 15:43

1 Answers1

2

According to angular documentation you can use the $any() type-cast function in certain contexts to opt out of type-checking for a part of the expression.

im.pankratov
  • 1,768
  • 1
  • 19
  • 19