Reputation: 568
I'm just starting out on some ember.js, and am pretty inexperienced. This is probably a very simple question to answer but I can't seem to get it to work. I'm in the controller for my chart trying to set range using
range: function() {
var dataArr = this.get("rawData");
if (!dataArr) return;
var range = "";
var xmax = -1 * Infinity;
var xmin = Infinity;
var ymax = -1 * Infinity;
var ymin = Infinity;
code to figure out xmin, max etc......
lowerBound = new Date(xmin)
upperBound = new Date(xmax)
range = d3.time.format.utc("%a, %b%e %-I:%M %p")(lowerBound) + " - " + d3.time.format.utc("%a, %b%e %-I:%M %p")(upperBound);
return range
}.observes('display', 'rawData'),
I then try to use this with handlebars {{range}} and it does not work... I dont know if I'm providing enough info but if anyone can help out its much appreciated, thank you!
Upvotes: 0
Views: 30
Reputation: 6947
You need to identify your range
property as a property, thusly:
range: function() {
var dataArr = this.get("rawData");
// blah blah, your implementation
return range;
}.property('rawData'),
By specifying rawData
as a dependency, Ember will automatically recompute range
if rawData
changes.
Upvotes: 1