feat(ivy): add flag to disable checking of text attributes (#33365)
For elements that have a text attribute, it may happen that the element is matched by a directive that consumes the attribute as an input. In that case, the template type checker will validate the correctness of the attribute with respect to the directive's declared type of the input, which would typically be `boolean` for the `disabled` input. Since empty attributes are assigned the empty string at runtime, the template type checker would report an error for this template. This commit introduces a strictness flag to help alleviate this particular situation, effectively ignoring text attributes that happen to be consumed by a directive. PR Close #33365
This commit is contained in:
@ -431,6 +431,7 @@ export class NgtscProgram implements api.Program {
|
||||
checkTemplateBodies: true,
|
||||
checkTypeOfInputBindings: true,
|
||||
strictNullInputBindings: true,
|
||||
checkTypeOfAttributes: true,
|
||||
// Even in full template type-checking mode, DOM binding checks are not quite ready yet.
|
||||
checkTypeOfDomBindings: false,
|
||||
checkTypeOfOutputEvents: true,
|
||||
@ -451,6 +452,7 @@ export class NgtscProgram implements api.Program {
|
||||
checkTemplateBodies: false,
|
||||
checkTypeOfInputBindings: false,
|
||||
strictNullInputBindings: false,
|
||||
checkTypeOfAttributes: false,
|
||||
checkTypeOfDomBindings: false,
|
||||
checkTypeOfOutputEvents: false,
|
||||
checkTypeOfAnimationEvents: false,
|
||||
|
Reference in New Issue
Block a user