How to use Aurelia's bindable decorator on a property with getter and setter

Viewed 2767

I have no problem using the @bindable decorator for a property on a class. E.g.

export class SomeClass {
    @bindable public SomeProperty: Date = new Date();
}

But I'm stumped when it comes to using it with properties that have a getter/setter implementation. E.g.

export class SomeClass2 {
    // Where should the @bindable go now?
    private _someProperty: Date = new Date();

    public get SomeProperty(): Date {
        return this._someProperty;
    }

    public set SomeProperty(value: Date) {
        // Do some manipulation / validation here
        this._someProperty = value;
    }
}

I'm sure I'm missing something simple here...

1 Answers
Related