Created
January 28, 2016 14:35
-
-
Save Mariusio/28c8524e4d4f19a931a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'div', | |
classNames: ['grid-stack-item'], | |
attributeBindings: ['data-gs-x', 'data-gs-y', 'data-gs-width', 'data-gs-height', 'data-gs-id'], | |
"data-gs-x": function() { | |
return this.get('chart').get('column'); | |
}.property(), | |
"data-gs-y": function() { | |
return this.get('chart').get('row') | |
}.property(), | |
"data-gs-width": function() { | |
return this.get('chart').get('width') | |
}.property(), | |
"data-gs-height": function() { | |
return this.get('chart').get('height') | |
}.property(), | |
"data-gs-id": function() { | |
return this.get('chart').get('id') | |
}.property(), | |
didInitAttrs(options) { | |
console.log('didInitAttrs', options); | |
}, | |
didUpdateAttrs(options) { | |
console.log('didUpdateAttrs', options); | |
}, | |
willUpdate(options) { | |
console.log('willUpdate', options); | |
}, | |
didReceiveAttrs(options) { | |
console.log('didReceiveAttrs', options); | |
}, | |
willRender() { | |
console.log('willRender'); | |
}, | |
didRender() { | |
console.log('didRender'); | |
}, | |
didInsertElement() { | |
console.log('didInsertElement'); | |
}, | |
didUpdate(options) { | |
console.log('didUpdate', options); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nitpick, use
Ember.computed
instead of.property