1

Is there a way, by using the Angular Compiler, to enable full template type-checking? I don't see it as an option listed here but I was curious if there was another way to enable it.

3
  • If you use VSC as your editor, the Angular Language Service extension does pretty much that Commented Aug 16, 2019 at 15:42
  • VSC will give me a warning, but will the build fail? Commented Aug 16, 2019 at 15:42
  • Does this answer your question? Angular Compiler not reporting missing property in template Commented Dec 11, 2023 at 17:03

2 Answers 2

2

When you use AOT compilation, you can control how your application is compiled by specifying template compiler options in the tsconfig.json

Add angularCompilerOptions object with fullTemplateTypeCheck property in tsconfig.json

"angularCompilerOptions": {
      "fullTemplateTypeCheck": true,
      "preserveWhitespaces": true,
                ...
    }

For More Info

Sign up to request clarification or add additional context in comments.

Comments

0

You can pass the argument noUnusedLocals: true and noUnusedParameters: true to your tsconfig.json under compilerOptions.

2 Comments

Hmm, I meant to check the .html for any unused references in the components' .ts file.
Even still, this will only check for unused locals and parameters inside of my .ts. Consider the case where I have an unused private property that is actually referenced inside of my .html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.