ReferenceError: property_x is not defined


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)
        .then((res) => {
            if ( {
                this.apiMsg.valid = true;
                this.apiMsg.text = `${} added to api`;
        }).catch(err => {
            console.log('err == ', err)
            this.apiError['message'] = `${err}`;

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=" and value.bind="newType.abbreviation

Any ideas?

1 Like

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.

1 Like