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.
-
If you use VSC as your editor, the Angular Language Service extension does pretty much thatbugs– bugs2019-08-16 15:42:11 +00:00Commented Aug 16, 2019 at 15:42
-
VSC will give me a warning, but will the build fail?User 5842– User 58422019-08-16 15:42:43 +00:00Commented Aug 16, 2019 at 15:42
-
Does this answer your question? Angular Compiler not reporting missing property in templateSofía– Sofía2023-12-11 17:03:05 +00:00Commented Dec 11, 2023 at 17:03
Add a comment
|
2 Answers
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,
...
}
Comments
You can pass the argument noUnusedLocals: true and noUnusedParameters: true to your tsconfig.json under compilerOptions.
2 Comments
User 5842
Hmm, I meant to check the
.html for any unused references in the components' .ts file.User 5842
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.