# Type safety in templates

**URL:** <https://discourse.aurelia.io/t/type-safety-in-templates/5354>\
**Category:** Framework Knowledge\
**Created:** [February 9, 2024, 3:40pm UTC](https://discourse.aurelia.io/t/type-safety-in-templates/5354 "2024-02-09T15:40:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adr](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@adr](https://discourse.aurelia.io/u/adr)\
**Post date:** [February 9, 2024, 3:40pm UTC](https://discourse.aurelia.io/t/type-safety-in-templates/5354/1 "2024-02-09T15:40:39Z")

</div>

Hello! New to aurelia and working in a codebase that uses it. In the course of developing, I had a question about the feasibility of type safety.

Specifically, I was curious if it’s possible to have some form of type checking in templates? Supposing I have an element with a bindable property with the type:

```auto
// my-component.ts
export class MyComponent {
  @bindable kind: "foo" | "bar";

  ...
}

```

and a call site that uses an incorrect value:

```auto
// some-file.html
<template>
  <my-component kind="baz"></my-component>
</template>

```

Is it possible to get a warning from the compiler? This would make refactoring simpler and catch certain bugs without relying on automated or manual testing.

---

<div class="post-metadata">

**Author:** ![sarp](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sarp](https://discourse.aurelia.io/u/sarp)\
**Post date:** [March 22, 2024, 10:22am UTC](https://discourse.aurelia.io/t/type-safety-in-templates/5354/2 "2024-03-22T10:22:02Z")

</div>

This is what I am also looking into also. Recently, it started to be very hard to keep track of changes in template side as our project grew in size.

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [March 26, 2024, 12:55pm UTC](https://discourse.aurelia.io/t/type-safety-in-templates/5354/3 "2024-03-26T12:55:08Z")

</div>

It’s a thorny issue, and a resolution is being attempted, 🤞
