|
|
|
|
|
by umvi
2479 days ago
|
|
I tried using it with Angular, but it doesn't seem to help much. For example, if you have something like: <button (click)="login(email, pass)" />
And then a TypeScript function like: login(email: string, pass: string) {
}
TypeScript can't help you at all here because all the typing is determined at runtime by Angular. Even if `email` is a number or a boolean, no problem, it will just happily pass it in.What benefit, then, does TypeScript provide? I understand it's compile-time guarantees, but how does that help if the types are coming in from HTML land which the TypeScript compiler doesn't examine at all? |
|
That's not really a typescript issue though, and it works great with libraries that don't use string templates. From what I've seen the angular community hasn't really prioritized a typecheck-able templating language.