Is it possible to utilize TypeScript in Angular 1.6 templates, following best practices such as components/bind-to-controller usage?
Consider the following template code:
<div>{{$ctrl.children[0].name}}</div>
If we know the type of the controller ($ctrl), can TypeScript aid in detecting errors such as:
- 'children' not existing on $ctrl
- 'children' not being an array
- items in 'children' lacking a 'name' property (and so on)?
It would be helpful to have code completion in VS Code as well.
I've come across the following issues:
- https://github.com/Microsoft/TypeScript/issues/6508
- https://github.com/Microsoft/TypeScript/issues/5151
However, it's unclear how things stand in the AngularJS 1.x world based on these problems.