Skip to content

Instantly share code, notes, and snippets.

@Mariusio
Created January 28, 2016 14:35
Show Gist options
  • Save Mariusio/28c8524e4d4f19a931a4 to your computer and use it in GitHub Desktop.
Save Mariusio/28c8524e4d4f19a931a4 to your computer and use it in GitHub Desktop.
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);
}
});
@locks
Copy link

locks commented Jan 28, 2016

nitpick, use Ember.computed instead of .property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment