We are building an application in Angular 2 and TypeScript. We try to statically check types where it is possible. Is there any way to check types in templates? Consider the fol
to quote the official statement:
In the template type-checking phase, the Angular template compiler uses the TypeScript compiler to validate the binding expressions in templates.
Template validation produces error messages when a type error is detected in a template binding expression, similar to how type errors are reported by the TypeScript compiler against code in a .ts file.
More at:
Angular Template checking https://angular.io/guide/aot-compiler#binding-expression-validation
Yet to activate it, you should build the app, by
ng build --aot
or
ng build --prod
but you can also activate it without building:
ng serve --aot