# Static @bindable

**URL:** <https://discourse.aurelia.io/t/static-bindable/1246>\
**Category:** Help Requests\
**Created:** [May 24, 2018, 2:47am UTC](https://discourse.aurelia.io/t/static-bindable/1246 "2018-05-24T02:47:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/johan/32/808_2.png) [@Johan](https://discourse.aurelia.io/u/Johan)\
**Post date:** [May 24, 2018, 2:47am UTC](https://discourse.aurelia.io/t/static-bindable/1246/1 "2018-05-24T02:47:29Z")

</div>

@inject has a static member so that you don’t have to use a decorator.

is there a way to the the same with bindable so that you don’t have to use @bindable but instead use a static member or something to that gives you the same end result?

something like perhaps

static bindable() { return [this.field1, this.field2]; }

---

<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:** [May 24, 2018, 5:58am UTC](https://discourse.aurelia.io/t/static-bindable/1246/2 "2018-05-24T05:58:08Z")

</div>

Recently merged PR [https://github.com/aurelia/templating/pull/614](https://github.com/aurelia/templating/pull/614) will do what you want. It will take a while to release though.

---

<div class="post-metadata">

**Author:** ![Johan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/johan/32/808_2.png) [@Johan](https://discourse.aurelia.io/u/Johan)\
**Post date:** [May 25, 2018, 9:51am UTC](https://discourse.aurelia.io/t/static-bindable/1246/3 "2018-05-25T09:51:58Z")

</div>

That sounds great, got a quick question and you need to forgive my ignorance here please.

Instead of using  
@bindable propertyName

Would using getters and setters give me the same result from an aurelia perspective?

get propertyName()  
set propertyName(newValue)

If from a aurelia perspective it flows the same throw the notification layers and binding then I can handle the changed function myself in the setter  
propertyNameChange(newValue, oldValue)

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [May 25, 2018, 2:08pm UTC](https://discourse.aurelia.io/t/static-bindable/1246/4 "2018-05-25T14:08:55Z")

</div>

That’s essentially what `@bindable` and `@obersvable` do under the hood. They patch the descriptor for propertyName with customised get/set functions.

> <https://github.com/aurelia/templating/blob/master/src/bindable-property.js>

> <https://github.com/aurelia/binding/blob/master/src/decorator-observable.js>
