Disable strictTemplates per file not entirely

Viewed 837

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.

1 Answers

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.

Related