# ReferenceError: property\_x is not defined

**URL:** <https://discourse.aurelia.io/t/referenceerror-property-x-is-not-defined/3362>\
**Category:** Framework Knowledge\
**Created:** [April 2, 2020, 3:44pm UTC](https://discourse.aurelia.io/t/referenceerror-property-x-is-not-defined/3362 "2020-04-02T15:44:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavlos](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@pavlos](https://discourse.aurelia.io/u/pavlos)\
**Post date:** [April 2, 2020, 3:44pm UTC](https://discourse.aurelia.io/t/referenceerror-property-x-is-not-defined/3362/1 "2020-04-02T15:44:34Z")

</div>

Hi,

So I am trying to POST an object from my aurelia component class. As soon as I added another prop to the object I get this weird error.

` ReferenceError: abbreviation is not defined`

```
 public newType: VulnType = { id: null, name: null , abbreviation: null};

   create(): void {
    console.log('create called ', this.newType)
    this.api.createVulnType(this.newType)
        .then((res) => {
            if (res.id) {
                this.vulnTypes.push(res);
                this.apiMsg.valid = true;
                this.apiMsg.text = `${res.name} added to api`;
                this.reset();
            }
        }).catch(err => {
            console.log('err == ', err)
            this.apiError['message'] = `${err}`;
            this.reset();
        });
}

```

Basically the api method is never called. Instead, it is caught here and the error message is displayed:

```
this.apiError['message'] = `${err}`;

```

I bind to the types in the template like so `value.bind="newType.name` and `value.bind="newType.abbreviation`

Any ideas?

---

<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:** [April 3, 2020, 4:00am UTC](https://discourse.aurelia.io/t/referenceerror-property-x-is-not-defined/3362/2 "2020-04-03T04:00:25Z")

</div>

The error you got should come from JS code, not template code. So I’d suggest having a look at your TypeScript/JavaScript code and see where abbreviation being used and see why it’s not declared inside that scope.
