Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable strictTemplates per file not entirely

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.

like image 200
Franz Peter Tebartz van Elst Avatar asked Nov 24 '25 14:11

Franz Peter Tebartz van Elst


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.

like image 99
Isuru Uthpala Avatar answered Nov 26 '25 11:11

Isuru Uthpala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!