# @customElement and typescript types

**URL:** <https://discourse.aurelia.io/t/customelement-and-typescript-types/4052>\
**Category:** Uncategorized\
**Created:** [February 20, 2021, 4:46am UTC](https://discourse.aurelia.io/t/customelement-and-typescript-types/4052 "2021-02-20T04:46:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manks](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/manks/32/1995_2.png) [@manks](https://discourse.aurelia.io/u/manks)\
**Post date:** [February 20, 2021, 4:46am UTC](https://discourse.aurelia.io/t/customelement-and-typescript-types/4052/1 "2021-02-20T04:46:13Z")

</div>

According to the Aurelia documentation, `@customElement` takes an “name” property. The usage in the documentation [implies that this property is optional](http://aurelia.io/docs/templating/html-behaviors#inheritance-with-html-behaviors):

```auto
import {useView, customElement} from 'aurelia-templating';
  import {IconButton} from './icon-button';
  
  @useView('./icon-button.html')
  @customElement()
  export class AddButton extends IconButton {
    constructor(){
      super();
      this.icon = 'plus';
      this.onClick = this.add;
    }
  
    add(){
      alert('Base add button');
    }
  }

```

Typescript doesn’t like that, though, and requires that you have an element name defined:

```auto
@customElement("add-button")

```

I ask because of component inheritance requires `@customElement` to be defined on the subclass when other Aurelia properties exist on the superclass, such as `@bindable` properties. See [github PR](https://github.com/aurelia/templating/pull/507) and [this question](https://discourse.aurelia.io/t/example-of-binding-inheritance/428).

Is the documentation wrong, or the Typescript type definition?

---

<div class="post-metadata">

**Author:** ![avrahamcool](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/avrahamcool/32/368_2.png) [@avrahamcool](https://discourse.aurelia.io/u/avrahamcool)\
**Post date:** [February 20, 2021, 4:45pm UTC](https://discourse.aurelia.io/t/customelement-and-typescript-types/4052/2 "2021-02-20T16:45:51Z")

</div>

I don’t see any problem with inheritance, or in the typescript definition.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/1/106eb4628810e953b750f4a6ed9f43a562347ae8.png)

---

<div class="post-metadata">

**Author:** ![manks](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/manks/32/1995_2.png) [@manks](https://discourse.aurelia.io/u/manks)\
**Post date:** [February 20, 2021, 6:40pm UTC](https://discourse.aurelia.io/t/customelement-and-typescript-types/4052/3 "2021-02-20T18:40:22Z")

</div>

When leaving out the name, I meant:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/0/0d0e0035f9a99ee8a788fb4115dc288edf8ebbb6.png)
