Last active
December 19, 2015 12:49
-
-
Save eviltrout/5957785 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
It's hard to answer these in a tweet :) | |
You can't pass arguments to computed properties unless you are creating custom setters, but that's a whole different topic! | |
What you probably want to do here is use an itemController for each row you are displaying (with the button.) | |
{{#each thing in things itemController="thing"}} | |
<button {{bindAttr disabled=thing.disabled}}>button</button> | |
{{/each}} | |
// Here I am assuming you have a property, currentRange in the IndexController. The thing | |
// controller compares the `range` of the 'thing' with the `currentRange` of the index controller. | |
App.ThingController = Ember.ObjectController.extend({ | |
needs: ['index'], | |
currentRange: Em.computed.alias('controllers.index.currentRange'), | |
disabled: function() { | |
return (this.get('range') === this.get('currentRange')); | |
}.property('range', 'currentRange') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment