Disable strictTemplates per file not entirely
Asked Answered
C

1

21

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.

Cline answered 5/11, 2020 at 14:47 Comment(1)
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 thoughImmolate
R
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.

Rescissory answered 24/6, 2022 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.