Fix Strict Templates

Documentation for Developers

Fix Angular strictTemplates warnings and errors

What this solves

When Angular Language Service shows “Some language features are not available. Enable strictTemplates…”, strict template type checking isn’t enabled in one or more tsconfig.*.json files.

Enable strict templates

Add the following to all relevant configs that the project/app or library uses:

Recommended locations:

Use these options:

"angularCompilerOptions": {
  "strictTemplates": true,
  "fullTemplateTypeCheck": true,
  "strictInjectionParameters": true,
  "strictInputAccessModifiers": true
}

Restart language services

Common fixes after enabling strict mode

"compilerOptions": {
  "paths": {
    "@environment": ["../../environments/environment.ts"]
  }
}

Troubleshooting