angularivy

Angular compiler option settings do not apply at the same time (strictTemplates, fullTemplateTypeCheck)


When you build the application after setting both strictTemplates and fullTemplateTypeCheck to true in the tsconfig.json file of my angular project, only the strictTemplates option is applied. Only the fullTemplateTypeCheck option must be applied alone to output results that contain new template errors. I am using Angular 10 version, and I want to know why both options are not applied at the same time.

This is the current tscconfig.json file setting, and when building with that setting, the fullTemplateTypeCheck option does not apply.

  "angularCompilerOptions": {
    "enableIvy": true,
    "strictTemplates": true,
    "fullTemplateTypeCheck": true,
  }

Solution

  • You can't apply both at the same time because they are actually two different values for the same setting.

    According to the documentation, 'strictTemplates' is a more strict superset of 'fullTemplateTypeCheck'.

    So you should set one or the other, but not both.