ember-binding-macros

0.3.1 • Public • Published

Ember Binding Macros

npm version Ember Observer Score Build Status

Ember has a great data binding system that is used in its templates. There is also a limited object syntax for it.

This addon enhances that syntax by letting you bind any property of an object to any other property by giving it a propertyBindings array:

var Staircase = Ember.Object.create({
  propertyBindings: ['fourth > third', 'third > second', 'second > first']
})
 
var stairs = Staircase.create({
  fourth: 'Redpaint'
})
 
stairs.get('third') //=> Redpaint
stairs.get('second') //=> Redpaint
stairs.get('first') //=> Redpaint
 
stairs.set('third', 'Bluepaint') //=> Bluepaint
 
stairs.get('second') //=> Bluepaint
stairs.get('first') //=> Bluepaint
stairs.get('fourth') // Redpaint
 
 

Installation

  • git clone this repository
  • npm install --save ember-binding-macros

Running Tests

  • ember test
  • ember test --server

Readme

Keywords

Package Sidebar

Install

npm i ember-binding-macros

Weekly Downloads

33

Version

0.3.1

License

MIT

Last publish

Collaborators

  • cowboyd