Skip to content

Instantly share code, notes, and snippets.

@joefiorini
Created October 2, 2013 19:36
Show Gist options
  • Save joefiorini/6799344 to your computer and use it in GitHub Desktop.
Save joefiorini/6799344 to your computer and use it in GitHub Desktop.
var Component = Ember.Component.extend({
classNameBindings: [":title", "isFeatured::singlestat"],
valueListenerShouldGenerate: false,
isFeatured: false,
init: function() {
var statPoint = this,
statId = statPoint.get("stat.id");
this.statDidChange();
this._super();
},
statDidChange: function() {
var statId = this.get("stat.id");
var computed = Ember.computed("queue." + statId, function() {
return this.get("queue." + statId);
});
Ember.defineProperty(this, "_value", computed);
this.propertyDidChange("_value");
}.observes("stat"),
value: function() {
return this.get("_value");
}.property("_value"),
label: function() {
return this.get("stat.displayName");
}.property("stat.displayName")
});
export default Component;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment